/* ============================================================
   PretzelPort — style.css
   Layout & components. Colors/fonts come from theme.css only.
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  border-top: 3px solid var(--accent); /* quiet brand signature */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

a { text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.prose a:hover { text-decoration-color: var(--accent-hover); }

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

.lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 42em;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.muted { color: var(--ink-soft); }

/* ---------- Layout ---------- */

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 4.5rem 0; }
.section-tight { padding: 3rem 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

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

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.brand { display: block; }
.brand:hover .brand-lockup rect[stroke-dasharray] {
  animation: weave 1.5s linear infinite;
}
@keyframes weave { to { stroke-dashoffset: -209; } }
.brand-lockup { width: 190px; height: auto; display: block; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] {
  color: var(--accent);
}

/* Dropdowns (CSS-only: hover + :focus-within for keyboard) */
.nav-item { position: relative; display: flex; align-items: center; }
/* extend the hover area down to the header edge so the dropdown doesn't
   close in the gap between link and panel */
.site-nav .nav-item { padding-block: 0.9rem; margin-block: -0.9rem; }

.site-nav .nav-item > a::after {
  content: " ▾";
  font-size: 0.7em;
  opacity: 0.55;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -0.9rem;
  min-width: 15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  padding: 0.5rem;
  z-index: 20;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown { display: block; }

.dropdown a {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}
.dropdown a:hover {
  background: var(--accent-tint);
  color: var(--ink);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); text-decoration: none; }

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.92rem; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding: 5rem 0; position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle,
    color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 55% 80% at 78% 45%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 80% at 78% 45%, black 30%, transparent 75%);
  pointer-events: none;
}
.hero > .container { position: relative; }
.hero h1 { max-width: 16em; }
.hero .lede { margin-top: 1rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

/* ---------- Icons ---------- */

.card-icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-bottom: 0.9rem;
  display: block;
}
.page-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

/* ---------- Photos ---------- */

.photo-band {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: 10px;
  /* subtle unifying treatment so mixed sources feel like one set */
  filter: saturate(0.88) contrast(1.03);
}

.photo-figure { margin: 0; }

.media-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: start;
}
.photo-side img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  filter: saturate(0.88) contrast(1.03);
}
.photo-caption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 0.6rem;
  letter-spacing: 0.02em;
}

.page-hero { padding: 4.5rem 0 3rem; }
.page-hero h1 { max-width: 18em; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.6rem;
  display: block;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 8%, transparent);
}
.card { transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--ink-soft); font-size: 0.97rem; }
.card .card-more {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Work cards ---------- */

.work-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  margin-bottom: 0.7rem;
}
.work-outcome {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ---------- Flow diagram (home) ---------- */

.flow-diagram {
  width: 100%;
  height: auto;
  margin-bottom: 2.5rem;
}
.flow-lines path {
  stroke-dasharray: 7 9;
  animation: flow 1.4s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -16; } }

/* ---------- Lists with accent markers ---------- */

.marked-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
}
.marked-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.7rem;
}
.marked-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.52em;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* ---------- Example / highlight block ---------- */

.highlight {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 2.5rem;
}

/* ---------- Numbered steps ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2rem;
}
.steps li {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 1.2rem;
  align-items: start;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.3;
}
.steps h3 { margin-bottom: 0.3rem; }
.steps p { color: var(--ink-soft); }

/* ---------- Stats strip ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  border-block: 1px solid var(--line);
  padding: 2.2rem 0;
}
.stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.15;
}
.stat-label {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 18em;
}

/* ---------- Oversized statement ---------- */

.statement {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.8vw, 2.7rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 22em;
  margin: 0;
}
.statement em {
  font-style: normal;
  color: var(--accent);
}

/* ---------- Two-column split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--footer-bg);
  color: var(--footer-ink);
  border-radius: 12px;
  padding: 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.cta-band h2 { margin: 0; }
.cta-band p { color: var(--footer-ink-soft); margin: 0.4rem 0 0; }

/* ---------- Footer ---------- */

.site-footer {
  background-color: var(--footer-bg);
  /* faint woven mark, bleeding off the corner */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 44'%3E%3Crect x='8' y='10' width='24' height='24' rx='7' fill='none' stroke='%235eb0a6' stroke-opacity='0.08' stroke-width='4' transform='rotate(45 20 22)'/%3E%3Crect x='24' y='10' width='24' height='24' rx='7' fill='none' stroke='%23f6f6f4' stroke-opacity='0.06' stroke-width='4' transform='rotate(45 36 22)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right -80px bottom -120px;
  background-size: 560px auto;
  color: var(--footer-ink);
  margin-top: 5rem;
  padding: 3.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--footer-ink-soft);
  font-size: 0.95rem;
  max-width: 24em;
  margin-top: 1rem;
}
.footer-brand .brand-lockup { width: 190px; }

.site-footer h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--footer-ink-soft);
  margin-bottom: 1rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: var(--footer-ink); font-size: 0.95rem; }
.site-footer a:hover { color: var(--accent-bright); text-decoration: none; }

.footer-meta {
  border-top: 1px solid color-mix(in srgb, var(--footer-ink) 15%, transparent);
  padding-top: 1.5rem;
}
.footer-meta p {
  color: var(--footer-ink-soft);
  font-size: 0.88rem;
  margin: 0;
}

/* ---------- Prose pages (legal etc.) ---------- */

.prose { max-width: 46em; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; }

.notice {
  background: var(--accent-tint);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ---------- Responsive ---------- */

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

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.25rem;
  }
  .site-nav a { padding: 0.6rem 0; }
  .site-nav .btn { margin-top: 0.75rem; padding: 0.6rem 1.3rem; }
  body.nav-open .site-nav { display: flex; }

  /* Dropdowns become always-visible indented sub-lists */
  .nav-item { flex-direction: column; align-items: flex-start; width: 100%; }
  .site-nav .nav-item { padding-block: 0; margin-block: 0; }
  .site-nav .nav-item > a::after { content: ""; }
  .dropdown {
    display: block;
    position: static;
    min-width: 0;
    background: transparent;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 0.4rem 1rem;
    margin-left: 0.2rem;
  }
  .dropdown a {
    padding: 0.35rem 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
    white-space: normal;
  }
  .dropdown a:hover { background: transparent; color: var(--accent); }

  .hero { padding: 3.5rem 0 3rem; }
  .hero-split { grid-template-columns: 1fr; gap: 2rem; }
  .media-split { grid-template-columns: 1fr; gap: 1.5rem; }
  .photo-band { aspect-ratio: 16 / 9; }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .highlight, .cta-band { padding: 2rem; }
}

/* ---------- Motion (progressive enhancement) ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card {
      animation: fade-in both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
    .steps li, .stat, .highlight {
      animation: rise-in both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
  }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  .flow-lines path, .brand-lockup rect { animation: none !important; }
}
