/* ═══════════════════════════════════════════════════════════════════════════
   HOME — "Warm Paper"
   A one-page personal landing for a one-person iOS studio. Warm off-white
   paper, near-black ink, a single ember accent. The apps live on the App
   Store; this page just says who builds them and how to reach him. The same
   palette carries the legal pages so the whole site reads as one artifact.
═══════════════════════════════════════════════════════════════════════════ */

/* ── Scoped theme tokens (override the dark "Midnight Aurora" base) ── */
body.home-page {
  --paper: #faf7f2;
  --ink: #1c1a16;
  --ink-soft: #57534a;
  /* Dimmest readable tier — keeps WCAG AA (~5:1 on --paper) for mono labels. */
  --ink-dim: #6e6a60;
  --ember: #b45309;
  --line: rgba(28, 26, 22, 0.14);
  --line-strong: rgba(28, 26, 22, 0.3);

  --home-display: var(--font-display);
  --home-body: var(--font-body);
  --home-mono: var(--font-mono);
  --measure: 720px;
}

/* ── Reset the inherited dark base ── */
html:has(body.home-page) { background: var(--paper); }

body.home-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  background-attachment: scroll;
  color: var(--ink);
  font-family: var(--home-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Replace the base grain with a faint warm wash */
body.home-page::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0; /* fallback for `inset` */
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 1;
  display: block;
  background:
    radial-gradient(110% 60% at 85% -10%, rgba(180, 83, 9, 0.05), transparent 60%),
    var(--paper);
}

body.home-page a { color: inherit; text-decoration: none; }
body.home-page a:hover { text-decoration: none; }

body.home-page ::selection { background: rgba(180, 83, 9, 0.2); }

body.home-page :focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 3px;
}

body.home-page ::-webkit-scrollbar-track { background: var(--paper); }
body.home-page ::-webkit-scrollbar-thumb { background: #d8d2c6; border-radius: 4px; }
body.home-page ::-webkit-scrollbar-thumb:hover { background: #c2bbac; }

/* ── Shared eyebrow treatment ── */
.home-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--home-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.home-eyebrow-rule {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Header
═══════════════════════════════════════════════════════════════════════════ */
.home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease);
}

.home-header.scrolled {
  border-bottom-color: var(--line);
}

.home-header-inner {
  width: min(var(--measure), 100%);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.home-brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ink);
  display: grid;
  place-items: center;
  color: var(--paper);
  font-family: var(--home-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.home-brand-name {
  font-family: var(--home-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* Scoped past `body.home-page a` so the link color survives (see lessons L8) */
.home-page .home-header-cta {
  font-family: var(--home-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
  white-space: nowrap;
}

.home-page .home-header-cta:hover {
  border-color: var(--ink);
  background: rgba(28, 26, 22, 0.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Main / Hero
═══════════════════════════════════════════════════════════════════════════ */
.home-main {
  flex: 1;
  width: min(var(--measure), 100%);
  margin: 0 auto;
  padding: 0 24px;
}

.home-hero {
  padding: clamp(64px, 12vh, 128px) 0 clamp(48px, 8vh, 88px);
}

.home-hero h1 {
  margin: 26px 0 0;
  font-family: var(--home-display);
  font-weight: 700;
  font-size: clamp(36px, 6.5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.home-hero h1 em {
  font-style: italic;
  color: var(--ember);
}

.home-lede {
  margin: 26px 0 0;
  max-width: 34em;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.home-lede strong {
  color: var(--ink);
  font-weight: 600;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 38px;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-family: var(--home-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: transform var(--duration-fast) var(--ease),
              background var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.home-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Scoped past `body.home-page a { color: inherit }` (lessons L8) */
.home-page .home-btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.home-page .home-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(28, 26, 22, 0.22);
}

.home-page .home-btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.home-page .home-btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(28, 26, 22, 0.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Elsewhere
═══════════════════════════════════════════════════════════════════════════ */
.home-elsewhere {
  padding: 8px 0 clamp(64px, 10vh, 112px);
}

.home-elsewhere-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.home-elsewhere-list li {
  border-bottom: 1px solid var(--line);
}

.home-elsewhere-list a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 18px 4px;
  transition: background var(--duration) var(--ease);
}

.home-elsewhere-list a:hover {
  background: rgba(28, 26, 22, 0.03);
}

.home-elsewhere-label {
  flex-shrink: 0;
  width: 108px;
  font-family: var(--home-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.home-elsewhere-detail {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  color: var(--ink-soft);
}

.home-elsewhere-arrow {
  flex-shrink: 0;
  font-size: 15px;
  color: var(--ink-dim);
  transition: transform var(--duration) var(--ease),
              color var(--duration) var(--ease);
}

.home-elsewhere-list a:hover .home-elsewhere-arrow {
  transform: translate(2px, -2px);
  color: var(--ember);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════════════════════════════════ */
.home-footer {
  border-top: 1px solid var(--line);
}

.home-footer-inner {
  width: min(var(--measure), 100%);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--ink-dim);
}

.home-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.home-page .home-footer-nav a {
  color: var(--ink-dim);
  transition: color var(--duration) var(--ease);
}

.home-page .home-footer-nav a:hover {
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .home-header-inner { padding: 14px 20px; }
  .home-brand-badge { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }
  .home-brand-name { font-size: 15px; }

  .home-main { padding: 0 20px; }
  .home-hero { padding-top: 56px; }
  .home-lede { font-size: 16px; }

  .home-btn { padding: 12px 20px; font-size: 14px; }

  .home-elsewhere-list a {
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 15px 2px;
  }
  .home-elsewhere-label { width: 100%; }
  .home-elsewhere-detail { font-size: 14px; }

  .home-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }
}
