/* ---------- Tokens ---------- */
:root {
  --bg: #f7f2e8;
  --bg-soft: #efe6d3;
  --bg-softer: #e3d5b3;
  --card: #fffdf8;
  --line: #e3d8bf;
  --line-soft: #ece2ca;
  --ink: #1c1811;
  --ink-dim: #6b6152;
  --ink-dimmer: #948a76;
  --rust: #d0451f;
  --rust-dark: #a8371a;
  --teal: #0e5c50;
  --teal-dark: #0a453c;

  --font-display: "Cormorant Garamond", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@view-transition { navigation: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

em {
  font-style: italic;
  color: var(--rust);
}

/* ---------- Custom cursor ---------- */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 22px; height: 22px;
  border: 1.5px solid var(--rust);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  transition: width .2s ease, height .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
  opacity: 0;
  mix-blend-mode: multiply;
}
.cursor-dot.is-visible { opacity: 1; }
.cursor-dot.is-hover { width: 46px; height: 46px; background: rgba(208,69,31,0.12); }
@media (hover: none), (pointer: coarse) { .cursor-dot { display: none; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 242, 232, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  margin-right: 32px;
}

.nav a {
  position: relative;
  font-size: 14px;
  color: var(--ink-dim);
  transition: color 0.2s ease;
  padding-bottom: 2px;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1.5px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--rust); transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(208,69,31,0.5); }

.btn-outline {
  border: 1px solid var(--line-soft);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--rust); color: var(--rust); transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid var(--line-soft);
  color: var(--ink-dim);
  padding: 10px 20px;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

.arrow { display: inline-block; transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero load-in ---------- */
.in-load {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.7s cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(var(--d) * 100ms + 100ms);
}
@keyframes heroIn { to { opacity: 1; transform: translateY(0); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 140px 0 120px;
  overflow: hidden;
}

.hero-inner { position: relative; z-index: 2; max-width: 780px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.08;
  margin: 0 0 28px;
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-dim);
  max-width: 560px;
  margin: 0 0 40px;
}

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

.hero-glow {
  position: absolute;
  top: -220px;
  right: -180px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(208, 69, 31, 0.14) 0%, rgba(14, 92, 80, 0.07) 45%, transparent 70%);
  filter: blur(20px);
  z-index: 1;
  pointer-events: none;
}
.hero-glow--b {
  top: auto; right: auto;
  bottom: -260px; left: -200px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(14, 92, 80, 0.1) 0%, transparent 65%);
}

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 56px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  margin: 0;
}

.section-note {
  font-size: 14px;
  color: var(--ink-dimmer);
  font-family: var(--font-mono);
  max-width: 340px;
  margin: 0;
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.work-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease;
}

.work-card:hover {
  border-color: var(--rust);
  transform: translateY(-6px);
  box-shadow: 0 28px 50px -24px rgba(28, 24, 17, 0.28);
}

.browser-frame { border-bottom: 1px solid var(--line); }

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.browser-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-soft); border: 1px solid var(--ink-dimmer); }
.browser-url {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-dimmer);
  background: var(--card);
  border: 1px solid var(--line-soft);
  padding: 3px 10px;
  border-radius: 6px;
  flex: 1;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-screenshot-wrap {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: var(--bg-soft);
}
.work-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
  display: block;
}
.work-card:hover .work-screenshot { transform: scale(1.08); }

.work-body { padding: 22px 24px 28px; }

.work-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.work-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dimmer);
}

.work-category {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
}

.demo-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  padding: 4px 10px;
  border-radius: 999px;
}

.work-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.3;
}

.work-desc {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 0 0 20px;
}

.work-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dimmer);
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.work-card:hover .work-year { color: var(--rust); }
.work-year { transition: color 0.25s ease; }

/* ---------- Field / services rows ---------- */
.field-grid { display: flex; flex-direction: column; }

.field-row {
  position: relative;
  display: grid;
  grid-template-columns: 80px 220px 1fr;
  align-items: center;
  gap: 24px;
  padding: 24px 20px;
  margin: 0 -20px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  transition: padding-left 0.3s ease;
}
.field-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  z-index: 0;
}
.field-row:hover::before { transform: scaleX(1); }
.field-row:hover { padding-left: 32px; }
.field-row:first-child { border-top: 1px solid var(--line); }
.field-row > * { position: relative; z-index: 1; }

.field-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--rust);
}

.field-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.field-desc {
  font-size: 14px;
  color: var(--ink-dim);
}

/* ---------- About ---------- */
.about-inner { max-width: 720px; }

.about-text {
  font-size: 17px;
  color: var(--ink-dim);
  margin: 0 0 32px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 16px;
  border-radius: 999px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skills li:hover { border-color: var(--teal); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 72px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 12px;
}

.footer-tag {
  font-size: 14px;
  color: rgba(247,242,232,0.6);
  max-width: 320px;
  margin: 0;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(247,242,232,0.45);
  margin: 0 0 16px;
}

.footer-col { display: flex; flex-direction: column; gap: 10px; }

.footer-col a {
  font-size: 14px;
  color: rgba(247,242,232,0.8);
  transition: color 0.2s ease;
}

.footer-col a:hover { color: #ff8a5e; }

.footer-bottom {
  border-top: 1px solid rgba(247,242,232,0.15);
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(247,242,232,0.4);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.2,.8,.2,1), transform 0.7s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .work-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .field-row { grid-template-columns: 50px 1fr; }
  .field-desc { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }

  .nav.nav-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 16px 24px 24px;
    gap: 18px;
  }

  .hero { padding: 100px 0 80px; }
  .section { padding: 72px 0; }
}
