/* =========================================================
   THE QUIET SWAGGER — V1 site styles
   Governed by: Color Standards v1.0, Typography Standards v1.0,
   Wordmark Usage Standards v1.0. Six locked colors only.
   ========================================================= */

:root {
  /* Locked palette (Color Standards v1.0) */
  --primary-dark: #0E1013;
  --primary-light: #F2F2EF;
  --structural-standard: #74787A;   /* light env: rules/borders only, never small text */
  --structural-reverse: #969A9B;    /* dark env: metadata, captions */
  --blue-standard: #1E5578;         /* light env: links, focus */
  --blue-reverse: #4F86A5;          /* dark env: links, focus */

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 20px;
  --max: 1240px;
  --read: 620px;
  --section: 80px;
}
@media (min-width: 768px) {
  :root { --gutter: 40px; --section: 140px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: var(--blue-standard); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--blue-standard); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--blue-reverse); }
h1, h2, h3, p, ul { margin: 0; }

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--primary-dark); color: var(--primary-light);
  padding: 12px 16px; font-weight: 600; font-size: 13px; text-decoration: none; z-index: 10;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.dark { background: var(--primary-dark); color: var(--primary-light); }
.dark a { color: var(--blue-reverse); }

/* ---------- Typography roles (Typography Standards v1.0) ---------- */
.t-hero, .t-h1, .t-h2, .t-title, .t-quote {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-kerning: normal;
}
.t-hero  { font-weight: 500; font-size: 34px; line-height: 1.05; letter-spacing: -0.01em; }
.t-h1    { font-weight: 600; font-size: 28px; line-height: 1.08; letter-spacing: -0.005em; }
.t-h2    { font-weight: 500; font-size: 22px; line-height: 1.2; }
.t-title { font-weight: 500; font-size: 18px; line-height: 1.25; }
.t-quote { font-weight: 400; font-size: 20px; line-height: 1.32; }

.t-deck  { font-weight: 400; font-size: 17px; line-height: 1.5; }
.t-body  { font-weight: 400; font-size: 16px; line-height: 1.65; }
.t-sub   { font-weight: 600; font-size: 18px; line-height: 1.25; letter-spacing: 0.01em; }
.t-meta  { font-weight: 500; font-size: 11px; line-height: 1.4; letter-spacing: 0.05em; text-transform: uppercase; }
.t-utility { font-weight: 600; font-size: 10px; line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; }

@media (min-width: 768px) {
  .t-hero  { font-size: 64px; }
  .t-h1    { font-size: 44px; }
  .t-h2    { font-size: 28px; }
  .t-title { font-size: 20px; }
  .t-quote { font-size: 26px; }
  .t-deck  { font-size: 20px; }
  .t-body  { font-size: 18px; }
  .t-sub   { font-size: 21px; }
  .t-meta  { font-size: 12px; }
  .t-utility { font-size: 11px; }
}
.dark .t-meta { color: var(--structural-reverse); }
.t-body p + p { margin-top: 1.1em; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  font-family: var(--sans); font-weight: 600; font-size: 13px; line-height: 1; letter-spacing: 0.01em;
  text-decoration: none; border: 1px solid var(--primary-dark);
  transition: background-color .15s ease, color .15s ease;
}
.btn-solid { background: var(--primary-dark); color: var(--primary-light); }
.btn-solid:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-line { background: transparent; color: var(--primary-dark); }
.btn-line:hover { background: var(--primary-dark); color: var(--primary-light); }
.dark .btn { border-color: var(--primary-light); }
.dark .btn-solid { background: var(--primary-light); color: var(--primary-dark); }
.dark .btn-solid:hover { background: transparent; color: var(--primary-light); }
.dark .btn-line { color: var(--primary-light); }
.dark .btn-line:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ---------- Header ---------- */
.site-header { padding: 20px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: block; line-height: 0; padding: 4px 0; }
.brand img { width: 168px; height: auto; }
.nav ul { list-style: none; padding: 0; display: flex; gap: 28px; }
.nav a {
  font-weight: 600; font-size: 13px; line-height: 1; letter-spacing: 0.01em;
  color: var(--primary-dark); text-decoration: none;
  display: inline-block; padding: 14px 0;
}
.nav a:hover { color: var(--blue-standard); }
.menu-toggle {
  display: none; background: none; border: 0; padding: 14px 0 14px 12px; margin: 0;
  font: 600 13px/1 var(--sans); letter-spacing: 0.01em; color: var(--primary-dark); cursor: pointer;
}
@media (min-width: 768px) {
  .site-header { padding: 28px 0; }
  .brand img { width: 200px; }
}
@media (max-width: 599px) {
  .js .menu-toggle { display: block; }
  .js .nav { position: relative; }
  .js .nav ul {
    display: none; position: absolute; right: 0; top: 100%; z-index: 5;
    flex-direction: column; gap: 0; min-width: 180px;
    background: var(--primary-light); border: 1px solid var(--structural-standard); padding: 8px 20px;
  }
  .js .nav.open ul { display: flex; }
  .nav ul { gap: 18px; }
}

/* ---------- Hero ---------- */
.hero { padding: 8px 0 var(--section); }
.hero-grid { display: grid; gap: 32px; }
.hero-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 22%; }
.hero-copy .t-deck { margin-top: 20px; max-width: 34em; }
.hero-copy .actions { margin-top: 32px; }
@media (min-width: 768px) {
  .hero-photo img { aspect-ratio: 4 / 3; }
}
@media (min-width: 960px) {
  .hero { padding-top: 24px; }
  .hero-grid { grid-template-columns: 7fr 5fr; gap: 64px; align-items: center; }
  .hero-copy { order: 1; }
  .hero-photo { order: 2; }
  .hero-photo img { aspect-ratio: 952 / 1270; object-position: 50% 50%; }
}

/* ---------- What is: "The Edit" ---------- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ph .ph-head { margin-top: 16px; max-width: 17em; }
.ph .ph-lead { margin-top: 20px; }
.edit { margin-top: 40px; max-width: 41em; line-height: 1.45; }
.edit s { color: var(--primary-dark); text-decoration-thickness: 1px; }
/* Desktop: 28px serif qualifies as large text, so Structural Standard (3.97:1) is approved here */
@media (min-width: 768px) { .edit s { color: var(--structural-standard); } }
.ph .ph-close { margin-top: 48px; display: grid; gap: 8px; }
@media (min-width: 768px) {
  .ph .ph-close { grid-template-columns: 1fr auto; align-items: baseline; margin-top: 64px; }
}

/* ---------- Book ---------- */
.book-grid { display: grid; gap: 40px; }
.book-cover img { width: 100%; max-width: 300px; }
.book-copy .t-h1 { margin-top: 16px; }
.book-copy .byline { margin-top: 16px; }
.book-copy blockquote { margin: 32px 0 0; padding: 0; }
.book-copy .t-body { margin-top: 24px; max-width: var(--read); }
.book-copy .actions { margin-top: 32px; }
@media (min-width: 768px) {
  .book-grid { grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
  .book-cover img { max-width: 400px; margin-left: auto; }
}

/* ---------- Writing ---------- */
.writing-head { max-width: var(--read); }
.writing-head .t-h1 { margin-top: 16px; }
.writing-head .t-deck { margin-top: 20px; }
.essays { list-style: none; padding: 0; margin-top: 56px; display: grid; gap: 40px; }
.essay { border-top: 1px solid var(--structural-standard); padding-top: 20px; display: flex; flex-direction: column; }
.essay .t-title { margin-top: 12px; }
.essay .t-title a { color: var(--primary-dark); text-decoration: none; }
.essay .t-title a:hover { text-decoration: underline; }
.essay .sub, .essay .excerpt { font-family: var(--sans); font-weight: 400; font-size: 16px; line-height: 1.65; }
.essay .sub { margin-top: 6px; }
.essay .excerpt { margin-top: 14px; }
@media (min-width: 768px) { .essay .sub, .essay .excerpt { font-size: 18px; } }
.essay .more { margin-top: 16px; font-weight: 600; font-size: 13px; letter-spacing: 0.01em; display: inline-block; padding: 12px 0; }
.writing .actions { margin-top: 48px; }
@media (min-width: 900px) {
  .essays { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .essay .more { margin-top: auto; padding-top: 20px; }
  .essay .excerpt { margin-bottom: 4px; }
}

/* ---------- Style ---------- */
.style-head { display: grid; gap: 24px; }
.style-head .t-body { max-width: var(--read); }
.gallery { list-style: none; padding: 0; margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gallery li { margin: 0; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .p img { aspect-ratio: 3 / 4; }
.gallery .l { grid-column: span 2; }
.gallery .l img { aspect-ratio: 4 / 3; }
@media (min-width: 768px) {
  .style-head { grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  /* Portrait sets the row height; landscape fills the remaining two columns */
  .gallery .l { position: relative; }
  .gallery .l picture { position: absolute; inset: 0; }
  .gallery .l img { aspect-ratio: auto; height: 100%; }
}

/* ---------- Andrew ---------- */
.about-grid { display: grid; gap: 40px; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.about-copy .ident { margin-top: 16px; }
.about-copy .t-body { margin-top: 28px; max-width: var(--read); }
@media (min-width: 768px) {
  .about-grid { grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
}

/* ---------- Final + footer ---------- */
.invite { text-align: left; }
.invite .actions { margin-top: 40px; }
.socials { list-style: none; padding: 0; margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.socials a { display: inline-block; padding: 12px 0; font-weight: 600; font-size: 13px; letter-spacing: 0.01em; }

.site-footer { padding: 72px 0 48px; }
.site-footer .inner { display: grid; gap: 40px; }
.site-footer .mark img { width: 220px; height: auto; }
.site-footer .byline { margin-top: 20px; color: var(--structural-reverse); }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.footer-links a { color: var(--primary-light); text-decoration: none; font-weight: 600; font-size: 13px; letter-spacing: 0.01em; display: inline-block; padding: 12px 0; }
.footer-links a:hover { color: var(--blue-reverse); }
.copyright { color: var(--structural-reverse); }
@media (min-width: 768px) {
  .site-footer .inner { grid-template-columns: 1fr auto; align-items: end; }
  .site-footer .mark img { width: 260px; }
  .copyright { grid-column: 1 / -1; }
}

/* Mobile: the lone first portrait spans the row instead of leaving a gap */
@media (max-width: 767px) {
  .gallery li:first-child { grid-column: span 2; }
  .gallery li:first-child img { aspect-ratio: 4 / 5; object-position: 50% 40%; }
  .ident .sep { display: none; }
  .ident .part { display: block; }
}

/* Short phones (iPhone SE class): shorter hero crop keeps both buttons on the first screen */
@media (max-width: 767px) and (max-height: 700px) {
  .hero-photo img { aspect-ratio: 5 / 4; object-position: 50% 18%; }
}

/* ---------- v2: dark header + hero, dark About, light invite ---------- */
.site-header.dark .nav a, .site-header.dark .menu-toggle { color: var(--primary-light); }
.site-header.dark .nav a:hover { color: var(--blue-reverse); }
@media (max-width: 599px) {
  .js .site-header.dark .nav ul { background: var(--primary-dark); border-color: var(--structural-reverse); }
}
/* Book cover: hairline so its black silhouettes don't merge into the dark field */
.book-cover img { border: 1px solid var(--structural-reverse); }
/* Divider between the two consecutive light sections (Writing -> Style) */
.style.section { padding-top: 0; }
.style > .wrap { position: relative; padding-top: var(--section); }
.style > .wrap::before {
  content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter);
  border-top: 1px solid var(--structural-standard);
}

/* Keep the head in frame on the train-platform shot (subject sits high in the photo) */
.gallery img[src*="style-train-platform"] { object-position: 50% 0; }
