/* ──────────────────────────────────────────────────────────────
   Boxshop portfolio — "warm studio" (light & airy)
   Display: Fraunces · Body: Hanken Grotesk
   ────────────────────────────────────────────────────────────── */

:root {
  --max: 72rem;

  --bg:        #f6f1e8;
  --bg-elev:   #fffdf8;
  --bg-elev-2: #efe6d8;

  --fg:       #2c2722;
  --fg-dim:   #6c6256;
  --fg-faint: #a0958685;

  --line:        rgba(70, 50, 28, 0.12);
  --line-strong: rgba(70, 50, 28, 0.22);

  --accent:      #c25e35;
  --accent-deep: #a84d27;
  --accent-soft: rgba(194, 94, 53, 0.12);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --shadow:       0 10px 30px -16px rgba(90, 60, 30, 0.28);
  --shadow-hover: 0 22px 48px -20px rgba(90, 60, 30, 0.34);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent-deep); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Soft warm atmosphere ───────────────────────────────────── */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 50% -8%, rgba(232, 168, 120, 0.30), transparent 60%),
    radial-gradient(50% 44% at 88% 4%, rgba(180, 196, 150, 0.22), transparent 58%),
    radial-gradient(46% 50% at 6% 18%, rgba(214, 174, 196, 0.16), transparent 60%),
    var(--bg);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  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='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ── Top bar ────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 232, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
          backdrop-filter: blur(14px) saturate(130%);
}
.topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.wordmark__glyph {
  /* Brand cube is 440:462, so size by height and let width follow. */
  width: auto;
  height: 19px;
  transition: transform 0.4s var(--ease);
}
.wordmark:hover .wordmark__glyph { transform: rotate(-12deg) scale(1.08); }

.lang-switcher {
  display: inline-flex;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switcher a {
  color: var(--fg-dim);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lang-switcher a:hover { color: var(--fg); }
.lang-switcher a[aria-current="page"] {
  color: var(--accent-deep);
  border-color: var(--line);
  background: var(--accent-soft);
}

/* ── Main + footer shells ───────────────────────────────────── */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sitefoot {
  max-width: var(--max);
  margin: 5rem auto 0;
  padding: 2rem 1.5rem 3.5rem;
  border-top: 1px solid var(--line);
}
.sitefoot small {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--fg-dim);
}

/* ── Hero (homepage) ────────────────────────────────────────── */

.hero {
  padding: 5rem 0 2.5rem;
}
.hero__eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.7rem, 8vw, 5rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0.8rem 0 0;
  max-width: 15ch;
  color: var(--fg);
}
.hero__title::after { content: "."; color: var(--accent); }
.hero__sub {
  margin: 1.5rem 0 0;
  max-width: 48ch;
  color: var(--fg-dim);
  font-size: 1.1rem;
  line-height: 1.65;
}

/* ── Hero dogfooding note ───────────────────────────────────── */

/* Plain inline flow — flex here would split the text nodes and the link
   into separate items, shattering the sentence into columns on narrow
   viewports when each fragment wraps independently. */
.hero__note {
  margin: 1.4rem 0 0;
  font-size: 0.92rem;
  color: var(--fg-dim);
}
.hero__note::before {
  content: "";
  display: inline-block;
  vertical-align: baseline;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  margin-right: 0.55rem;
  background: var(--accent);
  box-shadow: 0 2px 8px -2px rgba(194, 94, 53, 0.5);
}
.hero__note a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ── Sections (category chapters) ───────────────────────────── */

.section { margin-top: 5.5rem; }
.section:first-of-type { margin-top: 2.5rem; }

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.3rem 1rem;
  margin: 0 0 1.7rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.section-head__eyebrow {
  grid-column: 1;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.section-head__eyebrow .num { color: var(--accent); font-variant-numeric: tabular-nums; }
.section-head__title {
  grid-column: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.section-head__count {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}
.section__intro {
  margin: -0.4rem 0 1.7rem;
  max-width: 52ch;
  color: var(--fg-dim);
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Project grid ───────────────────────────────────────────── */

ul.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
}
ul.projects > li { margin: 0; display: flex; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.45s var(--ease);
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.card__preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev-2);
}
.card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s var(--ease);
}
.card:hover .card__preview img { transform: scale(1.035); }

/* monogram tile for screenshot-less projects — soft pastel, per project */
.card--placeholder .card__preview {
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 110% at 26% 14%, hsl(var(--h) 64% 90%), transparent 60%),
    radial-gradient(120% 120% at 86% 102%, hsl(calc(var(--h) + 35) 58% 91%), transparent 56%),
    var(--bg-elev-2);
}
.card__mono {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 8vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: hsl(var(--h) 40% 50%);
  transition: transform 0.5s var(--ease);
}
.card:hover .card__mono { transform: scale(1.06) rotate(-2deg); }

/* terminal pane for developer tools (no screenshot, by design) */
.card--tool .card__preview {
  display: block;
  padding: 1.1rem 1.15rem;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(194, 94, 53, 0.12), transparent 55%),
    #2a241e;
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
}
.term__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(246, 241, 232, 0.22);
}
.term__dot:first-child { background: rgba(194, 94, 53, 0.7); }
.term__lang {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 241, 232, 0.55);
}
.term__cmd {
  margin: 0;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.92rem;
  color: #f3ead9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.term__cmd .prompt { color: var(--accent); margin-right: 0.15ch; }
.term__cmd .caret {
  display: inline-block;
  width: 0.55ch;
  height: 1.05em;
  vertical-align: -0.16em;
  margin-left: 0.15ch;
  background: rgba(243, 234, 217, 0.85);
}

.card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.25rem 1.35rem;
}
.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.card__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.card__idx { color: var(--fg-faint); flex: none; }
.card__status {
  color: var(--fg-dim);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* status pills — text carries meaning; color is reinforcement only */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  white-space: nowrap;
}
.badge--live {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: transparent;
}
.badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.badge--archived { color: var(--fg-dim); }
.badge--powers {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.card__links { display: inline-flex; gap: 0.85rem; flex: none; }
.card__links a {
  position: relative;
  z-index: 2;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.card__links a::after { content: " ↗"; opacity: 0.6; }
.card__links a:hover { color: var(--accent-deep); }

.card__name {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.card__name a { color: var(--fg); text-decoration: none; }
/* stretched link — whole card navigates to the detail page */
.card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card:hover .card__name a { color: var(--accent-deep); }

.card__tagline {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Enterprise capabilities (editorial list, no cards) ─────── */

.capabilities__intro {
  margin: -0.4rem 0 2rem;
  max-width: 56ch;
  color: var(--fg-dim);
  font-size: 1.05rem;
  line-height: 1.65;
}
ul.capabilities { list-style: none; margin: 0; padding: 0; }
.cap {
  display: grid;
  grid-template-columns: minmax(0, 17rem) 1fr;
  gap: 0.4rem 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.cap:last-child { border-bottom: 1px solid var(--line); }
.cap__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.cap__title::before { content: "— "; color: var(--accent); }
.cap__blurb { margin: 0; color: var(--fg-dim); line-height: 1.6; }

/* ── Contact CTA ────────────────────────────────────────────── */

.cta {
  margin: 5.5rem 0 0;
  padding: clamp(2.25rem, 5vw, 3.5rem);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.cta__text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--fg);
  max-width: 18ch;
}
.cta__action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--accent-deep);
  box-shadow: 0 10px 24px -12px rgba(168, 77, 39, 0.7);
  transition: transform 0.3s var(--ease), background 0.2s, box-shadow 0.3s var(--ease);
}
.cta__action::after { content: "↗"; opacity: 0.85; }
.cta__action:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ── Footer cross-link ──────────────────────────────────────── */

.sitefoot a { color: var(--accent-deep); text-decoration: none; text-underline-offset: 3px; }
.sitefoot a:hover { text-decoration: underline; }

/* ── Detail page ────────────────────────────────────────────── */

.detail {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 0 1rem;
}
.back {
  margin: 0 0 1.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.back a { color: var(--fg-dim); text-decoration: none; }
.back a:hover { color: var(--accent-deep); }

.detail h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}
.detail .tagline {
  margin: 0.85rem 0 2.25rem;
  color: var(--fg-dim);
  font-size: 1.18rem;
  line-height: 1.5;
}
.detail p { color: var(--fg-dim); line-height: 1.75; }
.detail > p:first-of-type { color: var(--fg); }
.detail a { color: var(--accent-deep); text-underline-offset: 3px; }

.detail h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 1.1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--fg);
}

.detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.75rem 0 0;
}
.detail__links a {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.detail__links a:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.detail__links a::after { content: " ↗"; opacity: 0.6; }

ul.related {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
ul.related > li { margin: 0; }
ul.related a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-dim);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}
ul.related a:hover { color: var(--accent-deep); border-color: var(--line-strong); }

/* gallery */
figure { margin: 1.75rem 0; }
figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
figcaption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-dim);
}

/* ── Motion: gentle staggered load-in ───────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .hero, .section-head { animation: rise 0.7s var(--ease) both; }
  .section-head { animation-delay: 0.08s; }
  ul.projects > li {
    animation: rise 0.6s var(--ease) both;
    animation-delay: calc(0.12s + var(--i, 0) * 55ms);
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .term__cmd .caret { animation: blink 1.15s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 720px) {
  ul.projects { grid-template-columns: 1fr; }
  .hero { padding: 3.25rem 0 2rem; }
  .section { margin-top: 4rem; }
  .cap { grid-template-columns: 1fr; gap: 0.35rem; padding: 1.25rem 0; }
  .cta { flex-direction: column; align-items: flex-start; }
}
