/* Joinery Digital — main page styles (from Designs/Joinery Digital v2 B) */
:root {
  --ink: #0f1411;
  --ink-deep: #0c110e;
  --bg: #f6f7f4;
  --white: #ffffff;
  --muted: #4b524d;
  --muted-2: #2f3631;
  --muted-dark: #a3aca5;
  --on-dark: #eef2ee;
  --on-dark-2: #c9d1cb;
  --line: #e3e6e1;
  --line-soft: #e9ece7;
  --card-dark: #141b16;
  --line-dark: #222b25;
  --green: #22c55e;
  --green-light: #4ade80;
  --green-dark: #15803d;
  --green-deeper: #166534;
  --green-tint: #dcfce7;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: var(--green-deeper); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
::selection { background: #bbf7d0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Grid helpers ---------- */
.grid { display: grid; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .cols-4, .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .cols-4, .cols-3, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .projects > :last-child:nth-child(odd) { grid-column: auto; }
}

.container { max-width: 1200px; margin: 0 auto; }
.section { padding: clamp(72px, 10vw, 128px) clamp(20px, 5vw, 48px) 0; scroll-margin-top: 90px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--green-dark); }
.h2 {
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1;
  letter-spacing: -0.015em;
  max-width: 16ch;
}
.on-dark em, .accent { color: var(--green-light); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--green); color: var(--ink); font-weight: 600; }
.btn-primary:hover { background: var(--green-light); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16px; box-shadow: 0 10px 40px rgba(34, 197, 94, .4); }
.btn-xl { min-height: 56px; padding: 16px 28px; font-size: 17px; box-shadow: 0 10px 40px rgba(34, 197, 94, .4); }
.btn-ghost {
  min-height: 52px; padding: 14px 24px; font-size: 16px; font-weight: 500;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); color: var(--white);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .16); color: var(--white); }

/* ---------- Logo mark ---------- */
.mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--green);
  display: flex; align-items: center; justify-content: center; flex: none;
  font-family: var(--serif); font-size: 21px; line-height: 1; color: var(--ink);
}
.mark em { color: var(--ink); }
.mark-sm { width: 26px; height: 26px; font-size: 16px; }

/* ---------- Header ---------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: 12px clamp(12px, 3vw, 24px); }
.header-bar {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 20px;
  background: rgba(12, 17, 14, .62);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 15px; }
.brand-text b { font-weight: 600; letter-spacing: -0.01em; color: var(--white); }
.brand-text span { color: var(--on-dark-2); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--on-dark-2); text-decoration: none; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
.header-cta { min-height: 44px; padding: 10px 18px; font-size: 14px; gap: 8px; }
@media (max-width: 760px) { .nav { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  background: repeating-linear-gradient(135deg, #111813 0 12px, #151d17 12px 24px);
  color: var(--white);
}
.hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(12,17,14,.97) 0%, rgba(12,17,14,.7) 45%, rgba(12,17,14,.45) 75%, rgba(12,17,14,.7) 100%),
    radial-gradient(60% 50% at 15% 100%, rgba(34,197,94,.22), transparent 70%);
}
.hero-inner { position: relative; width: 100%; max-width: 1200px; margin: 0 auto; padding: 140px clamp(20px, 5vw, 48px) clamp(28px, 4vw, 48px); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: 12px; color: #d6ddd8;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.hero h1 {
  margin-top: 24px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(52px, 8.4vw, 128px); line-height: .95; letter-spacing: -0.02em; max-width: 13ch;
}
.hero h1 em { color: var(--green-light); }
.hero-row { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero-lede { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; max-width: 52ch; color: var(--on-dark-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.facts { margin-top: clamp(40px, 6vw, 72px); gap: 0; border-top: 1px solid rgba(255,255,255,.16); }
.facts > div { padding: 18px 20px 4px 0; }
.facts .big { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.facts .small { margin-top: 4px; font-size: 13.5px; color: var(--muted-dark); }

/* ---------- Work ---------- */
.work-list { margin-top: clamp(36px, 5vw, 56px); display: flex; flex-direction: column; gap: 20px; }
.card {
  background: var(--white); border: 1px solid var(--line-soft);
  box-shadow: 0 1px 2px rgba(15,20,17,.04), 0 20px 50px rgba(15,20,17,.06);
}
.featured {
  padding: clamp(14px, 1.6vw, 20px); border-radius: 32px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(24px, 3.5vw, 48px); align-items: center;
}
.stage {
  position: relative; border-radius: 22px; overflow: hidden;
  background: linear-gradient(155deg, #dcfce7 0%, #f0f5ee 55%, #e9eee8 100%);
  padding: clamp(18px, 3vw, 36px) clamp(18px, 3vw, 36px) clamp(44px, 6vw, 72px);
}
.browser { width: 84%; border-radius: 12px; overflow: hidden; background: var(--white); box-shadow: 0 20px 50px rgba(15,20,17,.14); }
.stage:not(:has(.phone)) { padding-bottom: clamp(18px, 3vw, 36px); }
.stage:not(:has(.phone)) .browser { width: 100%; }
.browser-bar { height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: #f3f5f2; border-bottom: 1px solid #e6e9e4; }
.browser-bar span { width: 7px; height: 7px; border-radius: 50%; background: #d4d9d2; }
.phone {
  position: absolute; right: clamp(14px, 3vw, 36px); bottom: clamp(16px, 2.5vw, 28px); width: 26%;
  background: var(--ink); padding: 5px; border-radius: 26px; box-shadow: 0 24px 50px rgba(15,20,17,.28);
}
.phone .shot { aspect-ratio: 9 / 19.5; border-radius: 21px; }

/* Screenshot slot: shows a label until an image in /assets loads over it */
.shot {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(135deg, #eef1ec 0 10px, #f6f7f4 10px 20px);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px;
}
.shot::before { content: attr(data-label); font-family: var(--mono); font-size: 11px; line-height: 1.4; color: var(--muted); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }

.featured-body { padding: clamp(4px, 1.5vw, 20px) clamp(8px, 1.5vw, 20px) clamp(12px, 1.5vw, 20px) 0; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.meta { font-size: 13px; color: var(--muted); }
.tag { font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: var(--green-tint); color: var(--green-deeper); }
.tag-own { background: var(--ink); color: var(--white); }
.featured h3 { margin-top: 16px; font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.4vw, 46px); line-height: 1.02; }
.featured .summary { margin-top: 12px; font-size: 18px; line-height: 1.5; }
.details { margin-top: 22px; display: grid; gap: 16px; }
.details .label { font-family: var(--mono); font-size: 12px; color: var(--green-dark); }
.details .label + p { margin-top: 4px; font-size: 15.5px; color: var(--muted); }
.stack { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.stack li { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted-2); }

.projects { gap: 20px; }
.project { padding: 14px 14px 24px; border-radius: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 1px 2px rgba(15,20,17,.04), 0 16px 40px rgba(15,20,17,.05); }
.project-media {
  border-radius: 20px; background: linear-gradient(155deg, #ecfdf3 0%, #f1f4ef 60%);
  padding: clamp(16px, 2.4vw, 28px); display: flex; justify-content: center; align-items: center; gap: 14px;
}
.project-media .browser { width: 100%; border-radius: 10px; box-shadow: 0 16px 40px rgba(15,20,17,.12); }
.project-media .browser-bar { height: 20px; gap: 5px; padding: 0 9px; }
.project-media .browser-bar span { width: 6px; height: 6px; }
.mini-phone { width: 31%; background: var(--ink); padding: 4px; border-radius: 22px; box-shadow: 0 16px 40px rgba(15,20,17,.2); }
.mini-phone + .mini-phone { transform: translateY(16px); }
.mini-phone .shot { aspect-ratio: 9 / 19.5; border-radius: 18px; }
.project-body { padding: 0 10px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.project h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; }
.project .summary { margin-top: 8px; font-size: 16.5px; line-height: 1.5; }
.project .desc { margin-top: 10px; font-size: 15px; color: var(--muted); }
.project .stack { margin-top: auto; }

/* ---------- Services (dark panel) ---------- */
.section-wide { padding: clamp(72px, 10vw, 128px) clamp(12px, 2vw, 24px) 0; scroll-margin-top: 90px; }
.dark-panel {
  max-width: 1280px; margin: 0 auto; border-radius: clamp(24px, 3vw, 40px);
  background: radial-gradient(50% 60% at 100% 0%, rgba(34,197,94,.22), transparent 70%), var(--ink-deep);
  color: var(--on-dark); padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 72px);
}
.dark-panel .eyebrow { color: var(--green-light); }
.tiles { margin-top: clamp(36px, 5vw, 56px); gap: 14px; }
.tile { padding: 28px; border-radius: 22px; display: flex; flex-direction: column; gap: 10px; }
.tile-dark { background: var(--card-dark); border: 1px solid var(--line-dark); }
.tile-dark .num { font-family: var(--mono); font-size: 12px; color: var(--green-light); }
.tile h3 { font-weight: 500; font-size: 20px; line-height: 1.3; }
.tile-dark p { font-size: 15px; color: var(--muted-dark); }
.tile-cta { background: var(--green); color: var(--ink); justify-content: space-between; gap: 20px; }
.tile-cta p { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.tile-cta .btn { align-self: flex-start; gap: 8px; padding: 10px 18px; background: var(--ink); color: var(--white); font-weight: 500; font-size: 14px; }
.tile-cta .btn:hover { background: var(--white); color: var(--ink); }

/* ---------- Process ---------- */
.tile-light { background: var(--white); border: 1px solid var(--line-soft); }
.tile-light .num { font-family: var(--serif); font-size: 56px; line-height: 1; color: var(--green); }
.tile-light h3 { margin-top: 6px; }
.tile-light p { font-size: 15px; color: var(--muted); }
.callout {
  margin-top: 14px; padding: clamp(24px, 3.5vw, 40px); border-radius: 22px;
  background: linear-gradient(120deg, #dcfce7, #f0f5ee 70%);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px clamp(24px, 4vw, 56px); align-items: start;
}
.callout h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 2.8vw, 38px); line-height: 1.08; max-width: 16ch; }
.callout p { font-size: 16.5px; color: var(--muted-2); max-width: 56ch; }

/* ---------- About ---------- */
.about { padding-bottom: clamp(72px, 10vw, 128px); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 32px clamp(28px, 5vw, 80px); }
.about .h2 { max-width: none; }
.about .lead { font-size: 19px; line-height: 1.6; }
.about .lead + p { margin-top: 18px; font-size: 16.5px; color: var(--muted); }
.chips { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 8px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: 14px; }
.chips i { font-style: normal; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { padding: 0 clamp(12px, 2vw, 24px) clamp(12px, 2vw, 24px); scroll-margin-top: 90px; }
.contact .dark-panel {
  background: radial-gradient(70% 80% at 50% 120%, rgba(34,197,94,.35), transparent 70%), var(--ink-deep);
  padding: clamp(56px, 8vw, 112px) clamp(20px, 5vw, 72px) clamp(24px, 3vw, 40px);
}
.contact h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 7.4vw, 108px); line-height: .98; letter-spacing: -0.02em; max-width: 13ch; }
.contact .actions { margin-top: 36px; }
.contact-links { margin-top: clamp(48px, 6vw, 80px); gap: 12px; }
.contact-link {
  padding: 20px 22px; border-radius: 18px; background: var(--card-dark); border: 1px solid var(--line-dark);
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--on-dark);
}
.contact-link:hover { border-color: var(--green-light); color: var(--on-dark); }
.contact-link span { font-family: var(--mono); font-size: 12px; color: var(--muted-dark); }
.contact-link b { font-weight: 500; font-size: 16px; overflow-wrap: anywhere; }
.site-footer {
  margin-top: clamp(40px, 5vw, 64px); padding-top: 20px; border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted-dark);
}
.site-footer > span:first-child { display: flex; align-items: center; gap: 10px; }

/* ---------- Modal form ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60; padding: 16px;
  background: rgba(12,17,14,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 540px; max-height: calc(100svh - 32px); overflow: auto;
  background: var(--white); color: var(--ink); border-radius: 28px; padding: clamp(22px, 4vw, 32px);
  box-shadow: 0 40px 100px rgba(12,17,14,.35);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head .eyebrow { font-size: 12px; }
.modal-head h2 { margin-top: 6px; font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 40px); line-height: 1; }
.close-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white);
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink);
}
.close-btn:hover { background: #f0f2ee; }
.tabs { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: #f0f2ee; }
.tabs button {
  min-height: 44px; border: 0; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500;
  background: transparent; color: var(--ink);
}
.tabs button[aria-selected="true"] { background: var(--white); box-shadow: 0 2px 8px rgba(15,20,17,.1); }
.form { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.form .hint { font-size: 15px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.field input, .field textarea {
  padding: 0 16px; border-radius: 14px; border: 1px solid #d9ddd7; background: #f9faf8;
  font-family: inherit; font-size: 16px; color: var(--ink); outline: none;
}
.field input { height: 50px; }
.field textarea { min-height: 140px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-tint); background: var(--white); }
.form-error { font-size: 14px; color: #b91c1c; }
.submit {
  margin-top: 4px; min-height: 54px; border: 0; border-radius: 999px; background: var(--green); color: var(--ink);
  font-family: inherit; font-weight: 600; font-size: 16px; cursor: pointer; box-shadow: 0 10px 30px rgba(34,197,94,.3);
}
.submit:hover { background: #16a34a; }
.submit:disabled { opacity: .6; cursor: progress; }
.form-foot { font-size: 13px; color: var(--muted); }
.sent { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.sent .check {
  width: 52px; height: 52px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.sent h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.sent p { font-size: 15.5px; color: var(--muted); }
.sent button {
  margin-top: 8px; align-self: flex-start; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; color: var(--ink);
}
.sent button:hover { border-color: var(--ink); }
.site-footer a { color: var(--muted-dark); }
.site-footer a:hover { color: var(--green-light); }
