:root {
  --ink: #1a1f1c;
  --ink-soft: #3d4640;
  --paper: #e4dfd4;
  --paper-deep: #d5cfc2;
  --paper-lift: #efece4;
  --line: rgba(26, 31, 28, 0.14);
  --forest: #2a5a48;
  --forest-deep: #1e4336;
  --moss: #6b8f7a;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Sora", system-ui, sans-serif;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 68rem;
  --radius: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(107, 143, 122, 0.18), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, rgba(42, 90, 72, 0.1), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

a {
  color: var(--forest);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--forest-deep);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.1rem;
  background: var(--paper-lift);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-thin {
  font-weight: 500;
  opacity: 0.55;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-menu a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-menu a[aria-current="page"],
.nav-menu a:hover {
  color: var(--ink);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--paper-lift);
}

.lang-switch a {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.lang-switch a.is-active {
  background: var(--forest);
  color: var(--paper-lift);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  background: var(--paper-lift);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  margin: 5px auto;
  background: var(--ink);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    inset: 4rem var(--space) auto;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--paper-lift);
    border: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(26, 31, 28, 0.12);
  }

  .nav-menu.is-open {
    display: flex;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--forest);
  color: var(--paper-lift);
}

.btn-primary:hover {
  background: var(--forest-deep);
  color: var(--paper-lift);
}

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

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-muted {
  background: transparent;
  border: 1.5px dashed var(--line);
  color: var(--ink-soft);
  cursor: default;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Experience */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.exp-item {
  padding: 1.5rem 1.5rem 1.5rem 0;
  border-top: 1px solid var(--line);
}

.exp-item:nth-child(odd) {
  padding-right: 1.75rem;
  border-right: 1px solid var(--line);
}

.exp-item:nth-child(even) {
  padding-left: 1.75rem;
}

.exp-item:nth-child(-n + 2) {
  border-top: none;
  padding-top: 0;
}

.exp-item h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.exp-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 32rem;
}

.exp-stack {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 2px solid var(--forest);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 48rem;
}

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

  .exp-item,
  .exp-item:nth-child(odd),
  .exp-item:nth-child(even) {
    padding: 1.35rem 0;
    border-right: none;
  }

  .exp-item:nth-child(-n + 2) {
    border-top: 1px solid var(--line);
    padding-top: 1.35rem;
  }

  .exp-item:first-child {
    border-top: none;
    padding-top: 0;
  }
}

/* Products as products */
.product-grid {
  display: grid;
  gap: 2rem;
}

.product {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.75rem;
  align-items: center;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

.product:last-child {
  border-bottom: 1px solid var(--line);
}

.product--wide h2 {
  margin: 0.35rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.product-meta h3 {
  margin: 0.35rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 650;
}

.product-meta p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  max-width: 36rem;
}

.product-thumb {
  border: 1px solid var(--line);
  background: #121512;
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  padding: 0.75rem;
}

.product-status {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--forest);
}

.product-status--dev {
  color: #8a6a2f;
}

.project-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.project-logo {
  width: min(100%, 18rem);
  margin-inline: auto;
  border: 1px solid var(--line);
  background: var(--paper-lift);
  padding: 1.5rem;
}

.shot-cap {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* MsgBox interactive demo — site chrome, library keeps its own themes */
.demo-panel {
  display: grid;
  gap: 1.75rem;
  padding: 1.75rem 0 0;
  border-top: 2px solid var(--forest);
}

.demo-block h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 650;
}

.theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.theme-pill {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--paper-lift);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-pill:hover {
  border-color: var(--forest);
  color: var(--ink);
}

.theme-pill.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper-lift);
}

/* Phone screenshots (PlanVida) */
.phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 1.25rem;
}

.phone-frame {
  margin: 0;
  background: var(--paper-lift);
  border: 1px solid var(--line);
  padding: 0.65rem 0.65rem 0.85rem;
}

.phone-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.phone-frame img {
  width: 100%;
  height: auto;
  max-height: 28rem;
  object-fit: cover;
  object-position: top center;
  background: #0a2a2e;
}

.phone-frame figcaption {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(26, 31, 28, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  margin: 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.lightbox-stage img {
  max-width: min(100%, 28rem);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(239, 236, 228, 0.2);
  background: #0a2a2e;
}

.lightbox-stage figcaption {
  color: var(--paper-lift);
  font-size: 0.95rem;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  font-family: var(--font-body);
  font-size: 1.75rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(239, 236, 228, 0.35);
  background: color-mix(in srgb, var(--paper-lift) 12%, transparent);
  color: var(--paper-lift);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

.lightbox-nav:hover,
.lightbox-close:hover {
  background: var(--forest);
  border-color: var(--forest);
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    padding: 3.5rem 0.75rem 1rem;
  }

  .lightbox-nav {
    position: absolute;
    bottom: 1rem;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }
}

@media (max-width: 800px) {
  .product,
  .project-split {
    grid-template-columns: 1fr;
  }

  .product-thumb {
    order: -1;
    max-height: 12rem;
  }
}

/* Hero */
.hero {
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: end;
}

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

.hero-kicker {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-lead {
  margin: 1.4rem 0 2rem;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.portrait {
  position: relative;
}

.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--line);
  filter: saturate(0.92) contrast(1.02);
}

.portrait-credit {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.portrait-credit a {
  font-weight: 600;
}

/* Sections */
.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-rule {
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

.section-head h2,
.page-hero h1,
.project-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-head p,
.page-hero p,
.project-hero p {
  margin: 0;
  color: var(--ink-soft);
}

.page-hero,
.project-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 1rem;
}

.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

.strip article {
  padding: 1.5rem 0 0;
  border-top: 2px solid var(--forest);
}

.strip h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 650;
}

.strip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* Services list — editorial, not cards */
.service-list {
  display: grid;
  gap: 0;
}

.service-item {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1.25rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.service-item:first-child {
  border-top: 1px solid var(--line);
}

.service-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--moss);
  font-weight: 650;
}

.service-item h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 650;
}

.service-item p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 40rem;
}

/* Project index */
.project-index {
  display: grid;
  gap: 2rem;
}

.project-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.project-row:last-child {
  border-bottom: 1px solid var(--line);
}

@media (max-width: 800px) {
  .project-row {
    grid-template-columns: 1fr;
  }
}

.project-row h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 650;
}

.project-row p {
  margin: 0 0 1.2rem;
  color: var(--ink-soft);
}

.project-row img {
  border: 1px solid var(--line);
  background: #111;
}

/* Feature bullets */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.feature-list li::before {
  content: "—";
  color: var(--forest);
  margin-right: 0.75rem;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.shot-grid figure {
  margin: 0;
  background: #0f1210;
  border: 1px solid var(--line);
  padding: 0.75rem;
}

.shot-grid img {
  width: 100%;
  height: auto;
}

.shot-grid figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--moss);
  text-align: center;
}

.shot-wide {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.shot-wide img {
  border: 1px solid var(--line);
  background: #1a1a1a;
}

.shot-wide--icon {
  max-width: 70%;
  margin-inline: auto;
}

.shot-wide--icon img {
  width: 100%;
  height: auto;
}

@media (max-width: 800px) {
  .shot-wide--icon {
    max-width: 100%;
  }
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
}

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

.channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.channel-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.channel-list a {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.channel-list a:hover {
  color: var(--forest);
}

.channel-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-stack label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.form-stack input,
.form-stack textarea {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper-lift);
  color: var(--ink);
}

.form-stack textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.form-flash {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.form-flash--ok {
  background: color-mix(in srgb, var(--forest) 12%, var(--paper-lift));
  border-color: var(--forest);
  color: var(--forest-deep);
}

.form-flash--err {
  background: color-mix(in srgb, #8b1e2f 10%, var(--paper-lift));
  border-color: #8b1e2f;
  color: #5c1420;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
}

.footer-inner {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Reveal motion */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

[data-reveal-delay="1"] {
  transition-delay: 0.08s;
}

[data-reveal-delay="2"] {
  transition-delay: 0.16s;
}

[data-reveal-delay="3"] {
  transition-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
