:root {
  --bg: #090f12;
  --bg-soft: #0f171c;
  --surface: rgba(18, 28, 34, 0.82);
  --surface-strong: #15222b;
  --text: #ebf6f9;
  --text-muted: #9eb3ba;
  --border: rgba(112, 153, 166, 0.24);
  --accent: #17d2b2;
  --accent-strong: #0fb999;
  --success: #22c55e;
  --danger: #f87171;
  --shadow: 0 24px 64px rgba(3, 10, 13, 0.45);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html[data-theme="light"] {
  --bg: #f5fbfc;
  --bg-soft: #e8f2f5;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --text: #102027;
  --text-muted: #4b6570;
  --border: rgba(69, 112, 125, 0.24);
  --accent: #00a889;
  --accent-strong: #00846c;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 18px 48px rgba(14, 58, 76, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Sora", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}

body::before {
  width: 340px;
  height: 340px;
  top: -140px;
  right: -80px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

body::after {
  width: 300px;
  height: 300px;
  left: -120px;
  bottom: -120px;
  background: radial-gradient(circle at 30% 30%, #38bdf8, transparent 70%);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: linear-gradient(
      to right,
      rgba(127, 158, 167, 0.06) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(127, 158, 167, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 100%);
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1160px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  margin: 14px auto 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.menu {
  display: none;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.menu a {
  transition: color 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  color: var(--text);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.theme-toggle {
  white-space: nowrap;
}

main {
  padding: 34px 0 84px;
}

section {
  margin-top: 56px;
}

.hero {
  display: grid;
  gap: 26px;
}

.hero-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(9px);
  box-shadow: var(--shadow);
  padding: 24px;
}

.hero-tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(23, 210, 178, 0.38);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.79rem;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 14px;
}

.accent {
  color: var(--accent);
}

.hero-description {
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-facts {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fact {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 27, 33, 0.56);
  padding: 12px;
}

html[data-theme="light"] .fact {
  background: rgba(255, 255, 255, 0.72);
}

.fact-value {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.fact-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn-primary,
.btn-ghost {
  border-radius: 13px;
  padding: 12px 18px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #04241d;
  box-shadow: 0 10px 26px rgba(23, 210, 178, 0.24);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(23, 210, 178, 0.35);
}

.btn-ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.hero-photo-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 260px;
}

.hero-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 10, 14, 0.56), transparent 60%);
}

.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo {
  object-position: center 18%;
  filter: saturate(1.08) contrast(1.06);
}

.hero-photo-label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: #e6f3f8;
}

.section-title {
  font-size: clamp(1.35rem, 2.6vw, 2.2rem);
  margin-bottom: 10px;
}

.section-lead {
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 64ch;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stack-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.stack-card:hover {
  transform: translateY(-4px);
  border-color: rgba(23, 210, 178, 0.45);
  box-shadow: 0 14px 26px rgba(2, 22, 28, 0.28);
}

.stack-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.stack-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.projects-grid {
  display: grid;
  gap: 14px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, border-color 0.28s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(23, 210, 178, 0.5);
}

.project-cover {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.project-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.project-text {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 5px 10px;
}

.project-link {
  font-weight: 600;
  color: var(--accent);
  width: fit-content;
  position: relative;
}

.project-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.project-link:hover::after,
.project-link:focus-visible::after {
  transform: scaleX(1);
}

.project-metrics {
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.87rem;
}

.project-metrics li {
  position: relative;
  padding-left: 14px;
  overflow-wrap: anywhere;
}

.project-metrics li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 9px;
}

.project-case {
  display: grid;
  gap: 7px;
}

.project-case p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-case strong {
  color: var(--text);
  font-weight: 600;
}

.services-grid {
  display: grid;
  gap: 12px;
}

.service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: rgba(23, 210, 178, 0.45);
}

.service-title {
  margin-bottom: 8px;
  font-size: 1rem;
}

.service-text {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.experience-grid {
  display: grid;
  gap: 12px;
}

.exp-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px;
}

.exp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.exp-title {
  font-size: 1rem;
}

.exp-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
}

.exp-list {
  list-style: none;
  display: grid;
  gap: 7px;
}

.exp-list li {
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  padding-left: 14px;
}

.exp-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 8px;
}

.workflow-grid {
  display: grid;
  gap: 12px;
}

.workflow-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.workflow-card:hover {
  transform: translateY(-3px);
  border-color: rgba(23, 210, 178, 0.45);
}

.workflow-step {
  display: inline-flex;
  border: 1px solid rgba(23, 210, 178, 0.35);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  border-radius: 999px;
  padding: 4px 9px;
  margin-bottom: 10px;
}

.workflow-title {
  font-size: 1rem;
  margin-bottom: 7px;
}

.workflow-text {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.contact-layout {
  display: grid;
  gap: 16px;
}

.contact-card,
.social-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 20px;
}

.contact-form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 12px 13px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 210, 178, 0.2);
}

textarea {
  min-height: 134px;
  resize: vertical;
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.82rem;
}

.invalid {
  border-color: var(--danger);
}

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.submit-btn {
  margin-top: 4px;
  width: fit-content;
  min-width: 184px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(4, 36, 29, 0.24);
  border-top-color: #04241d;
  border-radius: 50%;
  display: none;
  animation: spin 0.8s linear infinite;
}

.submit-btn.loading .spinner {
  display: inline-block;
}

.social-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.social-meta {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.social-meta strong {
  color: var(--text);
}

.social-meta p + p {
  margin-top: 8px;
}

.social-link {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  overflow-wrap: anywhere;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 14px;
  font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  border-top: 1px solid var(--border);
  padding: 11px 14px 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer {
  margin-top: 30px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.68s ease, transform 0.68s ease;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(16, 33, 26, 0.96);
  color: #d2fce2;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(53, 20, 24, 0.96);
  color: #fee2e2;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 768px) {
  section {
    margin-top: 84px;
  }

  .hero {
    grid-template-columns: 1.35fr 1fr;
    align-items: stretch;
  }

  .hero-card {
    padding: 30px;
  }

  .stack-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card:nth-child(1) {
    grid-column: span 2;
    flex-direction: row;
  }

  .project-card:nth-child(1) .project-cover {
    width: 46%;
    aspect-ratio: auto;
  }

  .project-card:nth-child(1) .project-content {
    width: 54%;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-grid,
  .experience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-layout {
    grid-template-columns: 1.35fr 0.8fr;
  }
}

@media (min-width: 1024px) {
  .menu {
    display: flex;
  }
}

@media (min-width: 1440px) {
  .hero-card {
    padding: 38px;
  }

  .hero-photo-wrap {
    min-height: 420px;
  }

  .project-content {
    padding: 18px 20px;
  }

  .workflow-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .services-grid,
  .experience-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 420px) {
  .hero-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .container {
    width: min(1160px, 94vw);
  }

  .topbar {
    top: 10px;
    margin-top: 10px;
  }

  .topbar-inner {
    padding: 10px 11px;
    border-radius: 14px;
    gap: 10px;
  }

  .brand-text {
    font-size: 0.88rem;
  }

  .theme-toggle {
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  main {
    padding: 22px 0 72px;
  }

  section {
    margin-top: 44px;
  }

  .hero-card,
  .contact-card,
  .social-card {
    padding: 18px;
  }

  h1 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .hero-description {
    margin-bottom: 18px;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .hero-actions {
    gap: 9px;
  }

  .project-content {
    padding: 14px;
  }

  .project-title {
    font-size: 1rem;
  }

  .section-title {
    font-size: clamp(1.28rem, 6.4vw, 1.6rem);
    margin-bottom: 8px;
  }

  .section-lead {
    font-size: 0.92rem;
    margin-bottom: 16px;
  }

  .submit-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .fact {
    padding: 11px;
  }

  .fact-value {
    font-size: 0.95rem;
  }

  .fact-label,
  .service-text,
  .workflow-text,
  .project-text {
    font-size: 0.88rem;
  }

  .hero-photo-wrap {
    min-height: 220px;
  }

  .hero-photo-label {
    font-size: 0.74rem;
    left: 10px;
    bottom: 10px;
  }
}
