/* ==========================================================================
   Carmel App Studio — Bodinsi
   Type scale is FLUID only between 375px and ~1150px, then frozen.
   Beyond that, extra viewport width becomes whitespace — never bigger text.
   Root font-size is never overridden, so browser zoom / user font-size work.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Palette */
  --paper:      #F3EDE3;
  --paper-soft: #EDE5D8;
  --ink:        #1E3050;
  --ink-deep:   #16263F;
  --body:       #46423C;
  --muted:      #6E6A62;
  --accent:     #8A6A2F;
  --rule:       rgba(30, 48, 80, 0.13);
  --rule-soft:  rgba(30, 48, 80, 0.07);

  /* Type scale — the two clamps below freeze at 1040px and 1138px */
  --t-label: 0.8125rem;                                 /* 13px */
  --t-body:  1.0625rem;                                 /* 17px */
  --t-lede:  1.3125rem;                                 /* 21px */
  --t-h1:    clamp(1.75rem, 1.2rem + 2vw, 2.5rem);      /* 28 → 40px */
  --t-hero:  clamp(2rem, 1.4rem + 2.6vw, 3.25rem);      /* 32 → 52px */

  /* Layout */
  --measure: 38rem;                   /* text column: ~70 characters at 17px */
  --gutter:  clamp(1.25rem, 4vw, 4rem);
  --shell:   76rem;

  --sans:  'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
}

/* --- Reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

::selection { background: #DCC9A3; color: var(--ink-deep); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--t-label);
}
.skip:focus { left: 0; color: var(--paper); }

/* --- Shared bits ---------------------------------------------------------- */

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;                 /* 12px — a label, not a heading */
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem var(--gutter);
}

.wordmark { display: flex; align-items: center; gap: 0.75rem; color: var(--ink); }

/* Cut-out arch mark — sized by height, width follows the 624:959 aspect */
.wordmark img {
  height: 40px;
  width: auto;
}

.wordmark span {
  font-family: var(--mono);
  font-size: 0.6875rem;               /* 11px */
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* On small phones the mark alone carries the brand — the nav needs the room */
@media (max-width: 30rem) {
  .wordmark span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav a { padding: 0.4rem 0.6rem; }
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.nav a:hover { background: rgba(30, 48, 80, 0.07); color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); background: rgba(30, 48, 80, 0.07); }

/* Floating pill — used only where the header sits over the photo */
.site-header--float .nav {
  padding: 0.3rem 0.35rem;
  background: rgba(243, 237, 227, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 1px 14px rgba(30, 48, 80, 0.09);
}

.site-header--ruled { border-bottom: 1px solid var(--rule); }

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 55%;
}

/* Wash the photo back so the type stays high-contrast.
   Wide layout is side-by-side, so the wash runs left→right.
   The narrow layout stacks, so below 62rem it runs top→bottom instead. */
.hero__wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(243, 237, 227, 0.55) 0%,
      rgba(243, 237, 227, 0) 22%,
      rgba(243, 237, 227, 0) 58%,
      rgba(243, 237, 227, 0.55) 84%,
      rgba(243, 237, 227, 0.86) 100%),
    linear-gradient(100deg,
      rgba(243, 237, 227, 0.97) 0%,
      rgba(243, 237, 227, 0.94) 28%,
      rgba(243, 237, 227, 0.66) 50%,
      rgba(243, 237, 227, 0.2)  74%,
      rgba(243, 237, 227, 0.04) 100%);
}

@media (max-width: 61.99rem) {
  .hero__wash {
    background: linear-gradient(to bottom,
      rgba(243, 237, 227, 0.97) 0%,
      rgba(243, 237, 227, 0.95) 38%,
      rgba(243, 237, 227, 0.78) 56%,
      rgba(243, 237, 227, 0.34) 76%,
      rgba(243, 237, 227, 0.62) 100%);
  }
}

.hero__body {
  flex: 1;
  display: grid;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vh, 3rem) var(--gutter) clamp(2rem, 5vh, 3.5rem);
}

.hero__copy { min-width: 0; max-width: 34rem; }

.hero h1 {
  margin: 0.9rem 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--t-hero);
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--ink-deep);
  text-wrap: balance;
}

.hero__lede {
  margin: 1.5rem 0 0;
  max-width: 42ch;
  font-size: var(--t-body);
  line-height: 1.65;
  color: #55504A;
  text-wrap: pretty;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2.25rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid rgba(30, 48, 80, 0.55);
  border-radius: 999px;
  background: rgba(243, 237, 227, 0.55);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero__device { min-width: 0; justify-self: center; }

.device {
  width: clamp(200px, 23vw, 278px);
  padding: 8px;
  border-radius: 44px;
  background: linear-gradient(160deg, #2A3242 0%, #14181F 60%, #262D3A 100%);
  box-shadow:
    0 40px 90px -34px rgba(20, 26, 38, 0.55),
    0 4px 18px rgba(20, 26, 38, 0.18);
}

.device img {
  width: 100%;
  aspect-ratio: 1290 / 2796;
  object-fit: cover;
  object-position: top;
  border-radius: 37px;
}

@media (min-width: 62rem) {
  .hero__body { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

/* Wide but short (laptops, landscape tablets): shrink the device, not the type */
@media (min-width: 62rem) and (max-height: 51rem) {
  .device { width: clamp(168px, 17vw, 216px); }
}

/* --- Document pages ------------------------------------------------------- */

.page { display: flex; flex-direction: column; min-height: 100dvh; }

.doc {
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(2.5rem, 8vh, 5rem) var(--gutter) clamp(4rem, 10vh, 6rem);
}

.doc h1 {
  margin: 1rem 0 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--t-h1);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
  text-wrap: balance;
}

.doc__meta {
  margin: 1.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.doc hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.doc__lede {
  margin: 0 0 2rem;
  font-family: var(--serif);
  font-size: var(--t-lede);
  line-height: 1.6;
  color: #2A3A52;
  text-wrap: pretty;
}

.doc h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--sans);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}

.doc p { margin: 0 0 1rem; text-wrap: pretty; }

.doc a[href^='mailto:'] {
  border-bottom: 1px solid rgba(30, 48, 80, 0.32);
}
.doc a[href^='mailto:']:hover { border-bottom-color: currentColor; }

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

.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1.75rem var(--gutter);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer--ruled { border-top: 1px solid var(--rule); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* Over the photo the footer needs no rule */
.hero .site-footer { position: relative; }

/* --- Preferences ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  :root { --gutter: 0; }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .site-header, .site-footer, .skip { display: none; }
  .doc { max-width: none; padding: 0; }
  .doc h1 { font-size: 22pt; }
  .doc h2 { font-size: 10pt; page-break-after: avoid; }
  .doc p { page-break-inside: avoid; }
  .doc a[href^='mailto:']::after { content: ' (' attr(href) ')'; font-size: 9pt; }
}
