/* michaelmaven.co.uk: one stylesheet for every page.
   Shares the Top Growth Experts palette and typefaces, but laid out as a personal page:
   a navy opening with the name set large, a signed letter, a short timeline, and links out. */

:root {
  --paper: #F5F6F4;
  --surface: #FFFFFF;
  --ink: #0E1820;
  --muted: #5C6871;
  --rule: #D8DCDC;
  --brass: #8E6F35;
  --band: #0E1820;
  --band-fg: #ECEEEC;
  --band-muted: #9AA6AE;
  --band-rule: #26333D;
  --band-brass: #CBAA66;

  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;

  --gutter: max(clamp(16px, 5vw, 64px), env(safe-area-inset-left, 0px));
  --gutter-r: max(clamp(16px, 5vw, 64px), env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1217; --surface: #111A21; --ink: #E8EBE9; --muted: #98A3AB; --rule: #24303A;
    --brass: #CBAA66; --band: #131E27; --band-fg: #ECEEEC; --band-muted: #9AA6AE; --band-rule: #2A3843;
    --band-brass: #D4B678; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B1217; --surface: #111A21; --ink: #E8EBE9; --muted: #98A3AB; --rule: #24303A;
  --brass: #CBAA66; --band: #131E27; --band-fg: #ECEEEC; --band-muted: #9AA6AE; --band-rule: #2A3843;
  --band-brass: #D4B678; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }

/* Buttons: on navy they are paper-coloured, on paper they are ink. */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font: 600 15px/1 var(--sans); letter-spacing: 0.02em; text-decoration: none;
  padding: 18px 28px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn .arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }
.navy { background: var(--band); color: var(--band-fg); }
.navy .label { color: var(--band-brass); }
.navy .btn { background: var(--band-brass); border-color: var(--band-brass); color: #0E1820; }
.navy .btn:hover { background: transparent; color: var(--band-brass); }

/* Opening */
.opening { position: relative; overflow: hidden; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; border-bottom: 1px solid var(--band-rule); position: relative; z-index: 2; }
.mark { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.mark .mm { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--band-brass); font: 600 1.35rem/1 var(--display); color: var(--band-brass); padding-bottom: 3px; }
.mark .who { display: grid; gap: 5px; line-height: 1; }
.mark .n { font: 600 1.3rem/1 var(--display); letter-spacing: 0.01em; }
.mark .s { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--band-muted); font-weight: 600; }
.topline .out { font-size: 14px; color: var(--band-fg); text-decoration: none; border-bottom: 1px solid var(--band-brass); padding-bottom: 2px; white-space: nowrap; }
.topline .out:hover { color: var(--band-brass); }

.opening-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
.opening-copy { display: grid; gap: 22px; justify-items: start; padding-block: clamp(28px, 3.4vw, 48px) clamp(32px, 3.4vw, 48px); }
.opening h1 { font-size: clamp(3.6rem, 6.6vw, 6.6rem); line-height: .9; letter-spacing: -0.02em; font-weight: 500; }
.opening h1 em { font-style: italic; color: var(--band-brass); }
.opening .intro { font-family: var(--display); font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.3; max-width: 34ch; }
.opening .creds { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--band-muted); }
/* A small brass diamond before each line, drawn as a background so it shows wherever the page is viewed. */
.opening .creds li { padding-left: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M4 0 8 4 4 8 0 4Z' fill='%23CBAA66'/%3E%3C/svg%3E") left center / 7px 7px no-repeat; }
/* Press logos in the opening, masked so they take the light text colour on navy. */
.press { width: 100%; display: grid; gap: 14px; padding-top: 22px; border-top: 1px solid var(--band-rule); }
.press-label { font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--band-muted); }
.press ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px clamp(18px, 2.2vw, 30px); }
.press .logo {
  --logo-h: clamp(15px, 1.6vw, 21px);
  height: calc(var(--logo-h) * var(--h, 1)); aspect-ratio: var(--ar); max-width: 100%;
  background: var(--band-fg); opacity: .78;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
@media (max-width: 480px) { .press .logo { --logo-h: 14px; } .press ul { gap: 14px 16px; } }
.photo { margin: 0; align-self: end; position: relative; }
.photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; filter: grayscale(1) contrast(1.05); }
.photo figcaption { position: absolute; left: -1px; bottom: 22px; transform: rotate(-90deg); transform-origin: left bottom; font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; color: var(--band-muted); white-space: nowrap; translate: 0 0; margin-left: -14px; }
@media (max-width: 860px) {
  .opening-grid { grid-template-columns: 1fr; }
  .opening-copy { padding-block: 44px 8px; }
  .photo { max-width: 380px; }
  .photo figcaption { display: none; }
}
@media (max-width: 520px) {
  .topline .out { display: none; }
  .photo { max-width: 260px; }
}

/* Arrival: the name settles in once. */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; }
  .rise.d1 { animation-delay: .1s; } .rise.d2 { animation-delay: .2s; } .rise.d3 { animation-delay: .3s; }
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}

/* The letter */
.letter { padding-block: clamp(72px, 10vw, 140px); }

/* "Read more" cue: pinned to the bottom of the screen on every device until the visitor scrolls.
   Navy with a brass edge, so it shows on both the navy opening and the light page. */
.scroll-cue {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 20;
  transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; background: var(--band); border: 1px solid var(--band-brass); color: var(--band-fg);
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(14, 24, 32, .28); transition: opacity .4s, transform .4s, visibility .4s;
}
.scroll-cue .arrow { color: var(--band-brass); font-size: 14px; letter-spacing: 0; line-height: 1; }
.scroll-cue:hover { color: var(--band-brass); }
.scroll-cue.gone { opacity: 0; visibility: hidden; transform: translate(-50%, 12px); }
@media (max-width: 520px) {
  .scroll-cue { padding: 0; width: 42px; height: 42px; justify-content: center; }
  .scroll-cue .t { display: none; }
  .scroll-cue .arrow { font-size: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue .arrow { animation: nudge 1.8s ease-in-out infinite; }
  @keyframes nudge { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
}
.letter-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.letter-side { display: grid; gap: 22px; position: sticky; top: 40px; }
.letter-side blockquote { margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(1.9rem, 3.4vw, 2.8rem); line-height: 1.15; }
.letter-side blockquote em { color: var(--brass); }
.letter-body { display: grid; gap: 22px; max-width: 62ch; font-size: 1.08rem; }
.letter-body p { color: var(--muted); }
.letter-body p strong { color: var(--ink); font-weight: 600; }
.letter-body p.first { color: var(--ink); font-size: 1.2rem; line-height: 1.6; }
.letter-body p.first::first-letter { float: left; font-family: var(--display); font-weight: 600; font-size: 4.6em; line-height: .78; margin: .08em .1em 0 0; color: var(--brass); }
.sign { margin-top: 14px; padding-top: 26px; border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.sign .sig { font-family: var(--display); font-style: italic; font-size: 2.6rem; line-height: 1; color: var(--ink); }
.sign span:last-child { font-size: 14px; color: var(--muted); }
@media (max-width: 900px) { .letter-grid { grid-template-columns: 1fr; } .letter-side { position: static; } }

/* Timeline */
.timeline { background: var(--surface); border-block: 1px solid var(--rule); padding-block: clamp(64px, 8vw, 104px); }
.timeline h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); margin: 14px 0 clamp(36px, 5vw, 56px); }
.marks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; }
.marks::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--rule); }
.marks li { position: relative; display: grid; gap: 10px; align-content: start; padding: 34px 28px 0 0; }
.marks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 9px; height: 9px; background: var(--brass); transform: rotate(45deg); }
.marks .when { font-family: var(--display); font-size: clamp(2.2rem, 3.4vw, 2.9rem); line-height: 1; color: var(--ink); font-variant-numeric: lining-nums; }
.marks p { font-size: 15px; color: var(--muted); max-width: 30ch; }
@media (max-width: 860px) {
  .marks { grid-template-columns: 1fr; padding-left: 26px; }
  .marks::before { left: 4px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .marks li { padding: 0 0 30px; }
  .marks li::before { left: -26px; top: 12px; }
}

/* Books and elsewhere */
.elsewhere { padding-block: clamp(64px, 9vw, 120px); }
.elsewhere-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 110px); align-items: start; }
.books { display: grid; gap: 20px; }
.books img { background: #FFFFFF; border: 1px solid var(--rule); padding: clamp(10px, 2vw, 22px); }
.books p { font-size: 15px; color: var(--muted); }
.books p em { color: var(--ink); }
.links { display: grid; gap: 14px; }
.links h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); margin-bottom: 10px; }
.links ul { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.links li a { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.links li:first-child a { border-top: 1px solid var(--ink); }
.links .t { font-family: var(--display); font-size: 1.55rem; line-height: 1.2; transition: color .2s, padding .25s; }
.links .d { font-size: 13.5px; color: var(--muted); text-align: right; }
.links a:hover .t { color: var(--brass); padding-left: 8px; }
@media (max-width: 900px) { .elsewhere-grid { grid-template-columns: 1fr; } .books { max-width: 560px; } }
@media (max-width: 480px) { .links li a { flex-direction: column; gap: 2px; } .links .d { text-align: left; } }

/* Closing band, with the footer folded into it */
.closing { padding-block: clamp(72px, 10vw, 136px) 0; }
.closing .wrap { display: grid; gap: 26px; justify-items: start; }
.closing h2 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); max-width: 18ch; line-height: 1.02; }
.closing h2 em { color: var(--band-brass); }
.closing p { color: var(--band-muted); max-width: 52ch; }
.foot { margin-top: clamp(56px, 8vw, 100px); width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; padding-block: 28px; border-top: 1px solid var(--band-rule); font-size: 14px; color: var(--band-muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.foot a { color: var(--band-fg); text-decoration: none; }
.foot a:hover { text-decoration: underline; text-decoration-color: var(--band-brass); }

/* 404 */
.lost { flex: 1; display: grid; align-content: center; }
.lost .wrap { width: 100%; display: grid; gap: 26px; justify-items: start; padding-block: clamp(56px, 9vw, 120px); }
.lost h1 { font-size: clamp(3rem, 7vw, 5.6rem); line-height: .95; }
.lost h1 em { font-style: italic; color: var(--band-brass); }
.lost p { color: var(--band-muted); max-width: 46ch; font-size: 1.1rem; }
.lost .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.lost .actions a.home { color: var(--band-fg); font-size: 15px; text-decoration-color: var(--band-brass); }
