:root {
  --bg: #f6f2ea;
  --bg-raised: #fffcf7;
  --bg-soft: rgba(255, 252, 247, 0.55);
  --border: #e4ddd3;
  --border-strong: #cfc5b8;
  --text: #1b2426;
  --text-muted: #4b585c;
  --text-dim: #6a777b;
  --text-faint: #8a9497;
  --accent: #b56a2c;
  --accent-2: #3d7a74;
  --max: 72rem;
  --display: Sora, system-ui, sans-serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --s: 0;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

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

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.4rem;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
textarea,
select {
  font: inherit;
}

.wrap {
  width: min(100% - 3rem, var(--max));
  margin-inline: auto;
}

.font-display {
  font-family: var(--display);
}

.font-mono {
  font-family: var(--mono);
}

.text-gradient {
  background: linear-gradient(100deg, #c47a3a, #5a9e98);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  background: #efe8dc;
  color: var(--text-muted);
  border-radius: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.35rem;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  box-shadow: 0 1px 0 rgb(80 60 40 / 0.04);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-0.25rem);
  border-color: #c47a3a66;
  box-shadow: 0 16px 28px -8px rgb(181 106 44 / 0.12);
}

.project-grid .card {
  cursor: default;
}

.project-grid > article[hidden] {
  display: none !important;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 0;
}

.btn-primary:hover {
  background: #c47a3ae6;
  box-shadow: 0 10px 15px -3px rgb(196 122 58 / 0.28);
}

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

.btn-ghost:hover {
  border-color: #c47a3a4d;
  color: var(--text);
  background: rgb(181 106 44 / 0.08);
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-on-scroll,
  .animate-on-scroll.visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .atmosphere-blob,
  .atmosphere-blob-a,
  .atmosphere-blob-b,
  .atmosphere-blob-c {
    animation: none;
    transform: none;
  }
}

/* Nav */
#site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

#site-nav.is-scrolled {
  background: rgb(246 242 234 / 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(228 221 211 / 0.8);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.04em;
}

.logo:hover {
  color: #c47a3acc;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
}

.menu-btn {
  display: inline-flex;
  background: none;
  border: 0;
  color: var(--text);
  padding: 0.25rem;
  cursor: pointer;
}

.menu-btn:hover {
  color: var(--text);
}

#icon-close { display: none; }
.menu-btn.is-open #icon-open { display: none; }
.menu-btn.is-open #icon-close { display: block; }

#mobile-menu {
  display: none;
  background: rgb(246 242 234 / 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem 1.5rem;
}

#mobile-menu.is-open {
  display: block;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgb(228 221 211 / 0.7);
}

.mobile-nav-link:hover {
  color: var(--accent);
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .menu-btn,
  #mobile-menu { display: none !important; }
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.atmosphere-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.atmosphere-blob-a {
  width: min(58vw, 42rem);
  height: min(58vw, 42rem);
  top: -12%;
  left: -18%;
  background: rgba(181, 106, 44, 0.28);
  transform: translate3d(0, calc(var(--s) * -0.06px), 0);
}

.atmosphere-blob-b {
  width: min(52vw, 38rem);
  height: min(52vw, 38rem);
  top: 28%;
  right: -22%;
  background: rgba(61, 122, 116, 0.22);
  transform: translate3d(0, calc(var(--s) * -0.12px), 0);
}

.atmosphere-blob-c {
  width: min(46vw, 34rem);
  height: min(46vw, 34rem);
  top: 72%;
  left: 28%;
  background: rgba(181, 106, 44, 0.14);
  transform: translate3d(0, calc(var(--s) * -0.18px), 0);
}

.atmosphere-grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: multiply;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 7rem 0 4rem;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: left;
  max-width: 48rem;
}

.brand-mark {
  margin: 0 0 1.35rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4.75rem, 16vw, 9.5rem);
  line-height: 0.85;
  letter-spacing: -0.06em;
  background: linear-gradient(100deg, #c47a3a, #5a9e98);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kicker {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--text);
}

.roles {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
}

/* Sections */
.section {
  padding: 6rem 0;
  scroll-margin-top: 4.5rem;
}

.section-alt {
  background: rgb(255 252 247 / 0.42);
}

.section-head {
  margin-bottom: 4rem;
}

.section-head h2,
.about-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.875rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--text);
}

.lede {
  margin: 1rem 0 0;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* About */
.about-grid {
  display: grid;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.about-copy p {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.monogram-wrap {
  position: relative;
  width: min(100%, 24rem);
  margin-inline: auto;
}

@media (min-width: 1024px) {
  .monogram-wrap { margin-left: auto; }
}

.monogram {
  aspect-ratio: 1;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #fffdf8 0%, #efe8dc 100%);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.monogram span {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.5rem, 8vw, 5.25rem);
  letter-spacing: -0.05em;
  user-select: none;
}

.monogram-accent {
  position: absolute;
  inset: auto -1rem -1rem auto;
  width: 100%;
  height: 100%;
  border-radius: 1rem;
  border: 1px solid #c47a3a33;
  z-index: -1;
}

/* Services */
.service-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.service-card {
  padding: 1.5rem;
}

.service-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: #c47a3a1a;
  border: 1px solid #c47a3a33;
}

.service-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--text);
}

.service-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Engagement flow */
.engagement-story {
  margin-top: 4.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--border-strong);
}

.engagement-intro {
  display: grid;
  gap: 1rem;
  align-items: end;
  margin-bottom: 2.25rem;
}

.engagement-intro .section-label {
  margin-bottom: 0.6rem;
}

.engagement-intro h3 {
  max-width: 38rem;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--text);
}

.engagement-intro > p {
  max-width: 33rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.process-grid {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  overflow: hidden;
  background: var(--border);
  list-style: none;
}

.process-step {
  position: relative;
  min-width: 0;
  padding: 1.4rem;
  background: var(--bg-raised);
}

.process-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.process-number {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgb(181 106 44 / 0.1);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent);
}

.process-timing {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-faint);
}

.process-step h4 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text);
}

.process-step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.ai-layer {
  position: relative;
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid rgb(61 122 116 / 0.28);
  border-radius: 0.8rem;
  background:
    radial-gradient(circle at 100% 0%, rgb(61 122 116 / 0.13), transparent 42%),
    rgb(255 252 247 / 0.82);
  overflow: hidden;
}

.ai-layer-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.ai-mark {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 8px 18px rgb(61 122 116 / 0.18);
}

.ai-layer-intro .section-label {
  margin: 0 0 0.35rem;
  color: var(--accent-2);
}

.ai-layer-intro h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text);
}

.ai-layer-intro p {
  max-width: 45rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.ai-outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.ai-outcomes span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(61 122 116 / 0.25);
  border-radius: 999px;
  background: rgb(61 122 116 / 0.07);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.ai-outcomes span::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent-2);
}

.ai-standard {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid rgb(61 122 116 / 0.2);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.ai-standard strong {
  color: var(--text);
}

@media (min-width: 760px) {
  .engagement-intro {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .process-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 2.35rem;
    right: -0.35rem;
    width: 0.7rem;
    height: 0.7rem;
    border-top: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-strong);
    background: var(--bg-raised);
    transform: rotate(45deg);
  }

  .ai-layer {
    grid-template-columns: minmax(17rem, 1.1fr) minmax(18rem, 0.9fr);
    align-items: center;
  }

  .ai-layer-intro {
    grid-row: span 2;
  }
}

/* Case studies */
.case-scroller {
  position: relative;
  min-width: 0;
}

.case-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 85%;
  column-gap: 1.15rem;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  padding-top: 0.65rem;
  padding-bottom: 1rem;
  scrollbar-color: var(--border-strong) transparent;
}

.case-list:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.case {
  --case-x: 50%;
  --case-y: 25%;
  scroll-snap-align: start;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg-raised);
  overflow: hidden;
  box-shadow: 0 8px 20px rgb(80 60 40 / 0);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}

.case::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    26rem circle at var(--case-x) var(--case-y),
    rgb(181 106 44 / 0.13),
    transparent 42%
  );
  opacity: 0;
  transition: opacity 0.28s ease;
}

.case > * {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .case:hover {
    z-index: 2;
    transform: translateY(-5px);
    border-color: rgb(181 106 44 / 0.5);
    box-shadow: 0 18px 42px rgb(80 60 40 / 0.14);
  }

  .case:hover::before {
    opacity: 1;
  }

  .case:hover .wire-browser {
    transform: translateY(-4px) scale(1.015);
  }

  .case:hover .wire-device {
    transform: translateY(-4px) rotate(-1.5deg) scale(1.015);
  }

  .case:hover .wire-tablet {
    transform: translateY(-3px) rotate(1.5deg);
  }

  .case:hover .case-copy h3 {
    color: var(--accent);
  }

  .case:hover .wire-chrome span {
    animation: case-dot-pulse 0.7s ease both;
  }

  .case:hover .wire-chrome span:nth-child(2) {
    animation-delay: 0.08s;
  }

  .case:hover .wire-chrome span:nth-child(3) {
    animation-delay: 0.16s;
  }
}

@keyframes case-dot-pulse {
  50% { transform: scale(1.65); }
}

@media (prefers-reduced-motion: reduce) {
  .case,
  .case::before,
  .case .wire-browser,
  .case .wire-device,
  .case .wire-tablet,
  .case .case-copy h3 {
    transition: none;
  }

  .case:hover,
  .case:hover .wire-browser,
  .case:hover .wire-device,
  .case:hover .wire-tablet {
    transform: none;
  }

  .case:hover .wire-chrome span {
    animation: none;
  }
}

@media (min-width: 720px) {
  .case-list {
    grid-auto-columns: calc((100% - 1.15rem) / 2);
  }
}

@media (min-width: 1024px) {
  .case-list {
    grid-auto-columns: calc((100% - 2.3rem) / 3);
  }
}

.case-visual {
  aspect-ratio: 16 / 10.5;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 70% 0%, rgba(61, 122, 116, 0.12), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(181, 106, 44, 0.1), transparent 50%),
    #efe8dc;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 1.1rem 1.15rem 0.9rem;
}

.case-visual.wire-phone {
  background:
    radial-gradient(circle at 50% 20%, rgba(181, 106, 44, 0.12), transparent 55%),
    #efe8dc;
}

.case-visual.wire-dual {
  display: grid;
  grid-template-columns: 1.12fr 0.58fr;
  gap: 0.55rem;
  align-items: stretch;
  padding: 1rem 1.05rem 0.85rem;
  place-items: stretch;
}

.case-visual.wire-dual .wire-browser {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.case-visual.wire-dual .wire-tablet {
  border: 2px solid var(--border-strong);
  border-radius: 0.55rem;
  background: var(--bg-raised);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px rgb(80 60 40 / 0.08);
  transition: transform 0.4s ease;
}

.case-visual.wire-dual .wire-tablet svg {
  display: block;
  width: 100%;
  height: 100%;
  flex: 1;
}

.case-visual .wire-browser,
.case-visual .wire-device {
  width: 100%;
  height: 100%;
}

.case-visual .wire-device {
  height: 100%;
  width: auto;
  max-width: 46%;
  margin-inline: auto;
}

.case-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.2rem 1.25rem;
}

.case-copy .tag-row {
  margin-top: auto;
}

.case-kicker {
  display: block;
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.case-copy h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text);
  transition: color 0.25s ease;
}

.case-lede {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.case-beats {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
}

.case-beat {
  margin: 0;
}

.case-beat dt {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.case-beat dd {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.case-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.case-nav button {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.case-nav button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.case-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Projects */
.project-grid {
  display: grid;
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.project-visual {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(61, 122, 116, 0.12), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(181, 106, 44, 0.1), transparent 50%),
    #efe8dc;
  position: relative;
  overflow: hidden;
}

.project-visual.wire {
  display: grid;
  place-items: center;
  padding: 1.1rem 1.15rem 0.85rem;
}

.wire-browser {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 0.4rem;
  background: var(--bg);
  box-shadow: 0 10px 28px rgb(80 60 40 / 0.08);
  transition: transform 0.4s ease;
}

.wire-chrome {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  height: 0.85rem;
  padding: 0 0.5rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.wire-chrome span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--border-strong);
}

.wire-chrome span:nth-child(2) {
  background: var(--accent);
  opacity: 0.75;
}

.wire-chrome span:nth-child(3) {
  background: var(--accent-2);
  opacity: 0.75;
}

.wire-browser svg {
  display: block;
  width: 100%;
  flex: 1;
}

.wire-phone {
  background:
    radial-gradient(circle at 50% 20%, rgba(181, 106, 44, 0.12), transparent 55%),
    #efe8dc;
}

.wire-device {
  height: 92%;
  aspect-ratio: 9 / 17;
  padding: 0.4rem 0.32rem;
  border: 2px solid var(--border-strong);
  border-radius: 1.05rem;
  background: var(--bg-raised);
  box-shadow: 0 12px 28px rgb(80 60 40 / 0.1);
  transition: transform 0.4s ease;
}

.wire-device svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0.55rem;
  overflow: hidden;
}

.card:hover .wire-browser,
.card:hover .wire-device {
  transform: translateY(-3px);
}

.project-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-body h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--text);
  transition: color 0.2s ease;
}

.card:hover .project-body h3 {
  color: var(--accent);
}

.project-body p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  flex: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.mini-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .mini-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .mini-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.mini-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.mini-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mini-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--text);
  transition: color 0.2s ease;
}

.mini-card:hover h3 {
  color: var(--accent);
}

.mini-card-head svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--text-faint);
  transition: color 0.2s ease;
}

.mini-card:hover .mini-card-head svg {
  color: var(--accent);
}

.mini-card p {
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  flex: 1;
}

/* FAQ */
.faq-section {
  border-top: 1px solid var(--border);
}

.faq-layout {
  display: grid;
  gap: 2.5rem;
}

.faq-list {
  border-top: 1px solid var(--border-strong);
}

.faq-list details {
  border-bottom: 1px solid var(--border-strong);
}

.faq-list summary {
  position: relative;
  padding: 1.35rem 3rem 1.35rem 0;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

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

.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--accent);
  transform: translateY(-50%);
  transition: transform 0.2s ease, background 0.2s ease;
}

.faq-list details[open] summary::after {
  background: rgb(181 106 44 / 0.08);
  transform: translateY(-50%) rotate(45deg);
}

.faq-list details p {
  max-width: 46rem;
  margin: -0.25rem 3rem 1.4rem 0;
  color: var(--text-muted);
  line-height: 1.65;
}

@media (min-width: 820px) {
  .faq-layout {
    grid-template-columns: minmax(15rem, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
  }

  .faq-layout .section-head {
    position: sticky;
    top: 7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-list summary::after {
    transition: none;
  }
}

/* Contact */
.contact-inner {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.contact-inner h2 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.875rem, 4vw, 3rem);
}

.contact-inner .lede {
  margin: 0 auto 2.5rem;
  font-size: 1.125rem;
}

.contact-trigger {
  font-size: 1.05rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
}

body.dialog-open {
  overflow: hidden;
}

.project-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgb(32 27 22 / 0.56);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: contain;
}

.project-dialog[hidden] {
  display: none;
}

.project-dialog-panel {
  position: relative;
  width: min(100%, 36rem);
  height: 100%;
  min-height: 100%;
  padding: clamp(2rem, 5vw, 3.5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 90% 5%, rgb(181 106 44 / 0.12), transparent 34%),
    var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 60px rgb(32 27 22 / 0.16);
  animation: project-panel-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes project-panel-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.project-dialog-close {
  position: absolute;
  z-index: 2;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgb(246 242 234 / 0.8);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-dialog-close:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(4deg);
}

.project-dialog-intro {
  padding-right: 2.5rem;
  margin-bottom: 2rem;
}

.project-dialog-panel.has-success {
  overflow: hidden;
}

.project-dialog-intro.is-leaving,
.project-form.is-leaving {
  pointer-events: none;
  animation: project-content-out 0.28s ease both;
}

@keyframes project-content-out {
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

.project-dialog-intro h2,
.project-form-success h2 {
  margin: 0.65rem 0 0.8rem;
  font-family: var(--display);
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.project-dialog-intro p,
.project-form-success p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.project-form {
  display: grid;
  gap: 1.15rem;
}

.project-form[hidden],
.project-form.is-submitted,
.project-dialog-intro[hidden],
.project-form-success[hidden] {
  display: none !important;
}

.project-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.form-field small {
  margin-left: 0.3rem;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-faint);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: normal;
  padding: 0.8rem 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 8.5rem;
  line-height: 1.5;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--accent);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgb(181 106 44 / 0.12);
}

.form-field textarea::placeholder {
  color: var(--text-faint);
}

.form-field.is-invalid input,
.form-field.is-invalid textarea,
.form-field.is-invalid select {
  border-color: #b94f3d;
  background: rgb(185 79 61 / 0.035);
  box-shadow: 0 0 0 3px rgb(185 79 61 / 0.09);
  animation: field-shake 0.32s ease;
}

.form-field.is-valid input,
.form-field.is-valid textarea,
.form-field.is-valid select {
  border-color: rgb(61 122 116 / 0.6);
  box-shadow: 0 0 0 3px rgb(61 122 116 / 0.07);
}

@keyframes field-shake {
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

.form-error {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #9b3d2d;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: normal;
}

.form-error:empty {
  display: none;
}

.form-error:not(:empty) {
  animation: form-error-in 0.2s ease both;
}

.form-error:not(:empty)::before {
  content: "!";
  width: 1rem;
  height: 1rem;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgb(185 79 61 / 0.12);
  font-family: var(--mono);
  font-size: 0.62rem;
}

@keyframes form-error-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-field-meta {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
}

.form-counter {
  margin-left: auto;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
}

.form-counter.is-near-limit {
  color: var(--accent);
}

.project-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
}

.project-form-footer p {
  max-width: 15rem;
  margin: 0;
  color: var(--text-faint);
  font-size: 0.7rem;
  line-height: 1.45;
}

.project-submit {
  flex-shrink: 0;
  cursor: pointer;
}

.project-submit:disabled {
  opacity: 0.62;
  cursor: wait;
}

.project-submit.is-loading svg {
  display: none;
}

.project-submit.is-loading::after {
  content: "";
  width: 0.9rem;
  height: 0.9rem;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: submit-spin 0.8s linear infinite;
}

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

.project-form-status {
  min-height: 1.4em;
  margin: 0;
  color: #9b3d2d;
  font-size: 0.8rem;
  line-height: 1.4;
}

.form-honeypot {
  display: none;
}

.project-form-success {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(2rem, 5vw, 3.5rem);
  opacity: 0;
  transform: translateY(36px);
}

.project-form-success.is-visible {
  animation: project-success-in 0.5s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes project-success-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-mark {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  margin-bottom: 1.5rem;
  border-radius: 999px;
  background: rgb(61 122 116 / 0.12);
  color: var(--accent-2);
}

.project-form-success .btn-ghost {
  margin-top: 2rem;
  cursor: pointer;
}

@media (max-width: 540px) {
  .project-dialog {
    width: 100vw;
  }

  .project-dialog-panel {
    padding:
      max(4.75rem, calc(env(safe-area-inset-top) + 3.5rem))
      max(1.25rem, env(safe-area-inset-right))
      max(2rem, env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
    border-left: 0;
  }

  .project-dialog-close {
    top: max(1.25rem, env(safe-area-inset-top));
    right: max(1.25rem, env(safe-area-inset-right));
  }

  .project-form-success {
    padding:
      max(4.75rem, calc(env(safe-area-inset-top) + 3.5rem))
      max(1.25rem, env(safe-area-inset-right))
      max(2rem, env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
  }

  .project-form-grid {
    grid-template-columns: 1fr;
  }

  .project-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .project-form-footer p {
    max-width: none;
  }

  .project-submit {
    justify-content: center;
  }
}

@supports (-webkit-touch-callout: none) {
  .project-dialog-panel {
    animation: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-dialog-panel {
    animation: none;
  }

  .project-dialog-intro.is-leaving,
  .project-form.is-leaving,
  .project-form-success.is-visible,
  .form-field.is-invalid input,
  .form-field.is-invalid textarea,
  .form-field.is-invalid select,
  .form-error:not(:empty),
  .project-submit.is-loading::after {
    animation: none;
  }

  .project-form-success.is-visible {
    opacity: 1;
    transform: none;
  }

  .project-dialog-close {
    transition: none;
  }

  .project-dialog-close:hover {
    transform: none;
  }
}

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

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.footer-brand strong {
  font-family: var(--display);
  color: var(--accent);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--text-dim);
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--text);
}

