/* Martin Ray Vaughan — shared stylesheet (v2).
   Layout: an index of a working life. A big name, then a ruled list of projects with years in film-edge mono,
   a contact-sheet photo strip, and one paint-splash colour (magenta) used sparingly. */
:root {
  --bg: #fbfbfc;
  --surface: #f0f1f4;
  --ink: #16171d;
  --text: #3d404b;
  --muted: #777b88;
  --line: #d9dbe2;
  --accent: #c8127a;
  --accent-ink: #ffffff;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121318; --surface: #1b1d24; --ink: #f2f3f6; --text: #c6c9d3; --muted: #8d91a0;
    --line: #2d3039; --accent: #ff5fb4; --accent-ink: #121318; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121318; --surface: #1b1d24; --ink: #f2f3f6; --text: #c6c9d3; --muted: #8d91a0;
  --line: #2d3039; --accent: #ff5fb4; --accent-ink: #121318; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--font-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--ink); font-weight: 700; line-height: 1; letter-spacing: -0.02em; text-wrap: balance; }

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.label { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header { padding-block: 20px; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; line-height: 0; text-decoration: none; }
.logo img { height: 48px; width: auto; display: block; }
.logo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo .logo-light { display: none; }
:root[data-theme="dark"] .logo .logo-dark { display: block; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--text); }
.nav a:hover { color: var(--accent); }

section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3rem); }

/* Intro */
/* Hero: text left, cutout portrait right; the photo's cropped bottom sits on the hero's bottom rule */
.intro { padding-top: clamp(32px, 6vw, 80px); padding-bottom: 0; border-bottom: 1.5px solid var(--ink); }
.intro .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.intro-text { display: grid; gap: 24px; justify-items: start; min-width: 0; padding-bottom: clamp(32px, 5vw, 64px); }
.intro h1 { font-size: clamp(3.2rem, 9vw, 7.5rem); line-height: 0.92; }
.intro h1 span { color: var(--accent); }
.intro-lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--text); max-width: 32rem; }
.intro-photo {
  width: 100%; max-width: 520px; height: auto; justify-self: center; align-self: end;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 0.8rem 1.3rem; border-radius: 999px; text-decoration: none;
  font: 500 0.98rem/1 var(--font-body); border: 1.5px solid var(--ink); color: var(--ink);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Projects + Ideas — magazine grid of photo cards; headline overlaid on the image (Chester-style) */
.mag { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.masonry { columns: 2; column-gap: 18px; margin-bottom: -18px; }
.masonry .story { break-inside: avoid; margin-bottom: 18px; width: 100%; }
.story.short .ph span { display: none; }
.story.tall { aspect-ratio: 3 / 4; }
.story.square { aspect-ratio: 1 / 1; }
.story.short { aspect-ratio: 5 / 4; }
.story {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 16px;
  background: var(--surface); aspect-ratio: 1 / 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 20px 22px; text-decoration: none; color: var(--ink);
}
.story .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; margin: 0; border: 0; transition: transform .5s ease; }
.story::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, var(--surface) 0%, color-mix(in srgb, var(--surface) 80%, transparent) 28%, transparent 62%); }
.story:hover .cover { transform: scale(1.03); }
.story-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; color: var(--muted); }
.story-top span:first-child { background: color-mix(in srgb, var(--surface) 75%, transparent); padding: 1px 6px; margin-left: -6px; border-radius: 4px; }
.story .year { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; align-self: center; }
.story-body { display: grid; gap: 10px; justify-items: start; }
.chip {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 6px; padding: 3px 8px;
}
.story h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(1.8rem, 2.6vw, 2.3rem); line-height: 1; letter-spacing: -0.01em; }
.story p { font-size: 1rem; color: var(--text); max-width: 32rem; }
.story.lead { aspect-ratio: auto; min-height: 420px; padding: 24px 28px 30px; }
.story.lead h3 { font-size: clamp(3rem, 6vw, 5rem); }
.story:hover h3 { color: var(--accent); }
.story /* Photo placeholder (until real images go in) */
.ph { place-items: start center; padding-top: 24%; }

/* Photography — contact sheet */
.photo { background: var(--ink); color: var(--bg); }
.photo h2, .photo .section-head .label { color: var(--bg); }
.photo .label { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.sheet { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.frame { display: grid; gap: 8px; margin: 0; }
.frame a { display: block; overflow: hidden; }
.frame img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; transition: transform .5s ease; }
.frame a:hover img { transform: scale(1.03); }
.frame figcaption { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; color: color-mix(in srgb, var(--bg) 55%, transparent); }
.photo-offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; margin-top: 40px; padding-top: 32px; border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent); }
.photo-offer p { max-width: 38rem; color: color-mix(in srgb, var(--bg) 85%, transparent); }
.photo-offer strong { color: var(--bg); font-weight: 600; }
.photo .btn { border-color: var(--bg); color: var(--bg); }
.photo .btn:hover { background: var(--bg); color: var(--ink); }
.photo .btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.ph {
  aspect-ratio: 4 / 5; margin-bottom: 6px; display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, var(--surface) 0 12px, color-mix(in srgb, var(--surface) 70%, var(--line)) 12px 24px);
  border: 1px solid var(--line);
}
.ph span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 4px 8px; }

/* About + resume */
.about { background: var(--surface); padding-bottom: 0; }
.about .wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
/* Cutout portrait stands on the bottom edge of the section */
.about-photo { width: 100%; max-width: 380px; height: auto; justify-self: center; align-self: end; }
.about-text { display: grid; gap: 18px; max-width: 38rem; align-self: center; padding-bottom: clamp(56px, 8vw, 104px); }
.about-text h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 8px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.facts div { display: grid; gap: 4px; }
.facts dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 36px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; align-items: baseline; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--text); }

@media (max-width: 860px) {
  .intro .wrap, .photo-offer, .about .wrap { grid-template-columns: minmax(0, 1fr); }
  .intro-photo { max-width: 280px; }
  .intro-text { padding-bottom: 0; }
  .about-photo { order: 2; max-width: 300px; }
  .about-text { padding-bottom: 8px; }
  .mag { grid-template-columns: minmax(0, 1fr); }
  .story.lead { aspect-ratio: 1 / 1; min-height: 0; }
  .sheet { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .masonry { columns: 1; }
}

/* Guaranteed Human badge (footer) */
.human-badge { flex-basis: 100%; display: flex; align-items: center; gap: 16px; padding-bottom: 22px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.seal { width: 72px; height: 72px; flex: none; color: var(--ink); }
.seal-text { font-family: var(--font-mono); font-size: 9px; fill: currentColor; }
.seal .print { stroke: var(--accent); }
.human-badge p { font-size: 0.92rem; line-height: 1.5; color: var(--text); max-width: 40rem; }
.human-badge strong { color: var(--ink); font-weight: 600; }

/* Projects, Essays & Ideas: second magazine block sits under the first */
.mag-next { margin-top: 18px; scroll-margin-top: 24px; }

/* Video */
.video { border-top: 1px solid var(--line); }
.reels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; }
/* Odd number of videos: the first one runs full width so no tile is left alone */
.reels > .reel:first-child:nth-last-child(2n+1) { grid-column: 1 / -1; }
.reel { display: grid; gap: 12px; text-decoration: none; color: var(--ink); }
.reel .thumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: 12px; margin: 0; transition: transform .4s ease; }
.reel:hover .thumb { transform: scale(1.02); }
.reel-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.reel h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em; }
.reel:hover h3 { color: var(--accent); }
.reel[aria-disabled="true"] { pointer-events: none; }
@media (max-width: 860px) { .reels { grid-template-columns: minmax(0, 1fr); } }

/* Texture: white Gulf Coast sand behind the header and footer, with a few small shells.
   All drawn in code (SVG noise and shapes), so there are no image files to load. */
:root {
  --sand: #fcfcfb;
  --sand-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.62 0 0 0 0 0.6 0 0 0 0 0.56 0 0 0 1.5 -0.66'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23g%29'/%3E%3C/svg%3E");
  --sand-drift: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='300'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.022' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.7 0 0 0 0 0.68 0 0 0 0 0.64 0 0 0 0.45 -0.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23d%29'/%3E%3C/svg%3E");
  --shell-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23cdb9ad' stroke-width='1.1' stroke-linejoin='round'%3E%3Cpath d='M20 35 C9 31 3.5 22 5 14 C7 6 33 6 35 14 C36.5 22 31 31 20 35 Z' fill='%23fbf3ee'/%3E%3Cpath d='M20 35 L6 14'/%3E%3Cpath d='M20 35 L9 9'/%3E%3Cpath d='M20 35 L14.5 6'/%3E%3Cpath d='M20 35 L20 5'/%3E%3Cpath d='M20 35 L25.5 6'/%3E%3Cpath d='M20 35 L31 9'/%3E%3Cpath d='M20 35 L34 14'/%3E%3Cpath d='M15 34 L13.5 38 L26.5 38 L25 34' fill='%23f6e9e2'/%3E%3C/g%3E%3C/svg%3E");
  --shell-spiral: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23cbb8ab' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M8 27 C4 18 10 7 21 7 C31 7 36 15 33 23 C31 30 23 34 15 33 C11 32.5 9 30 8 27 Z' fill='%23fcf5f0'/%3E%3Cpath d='M21 20 C19.5 18.5 21 16.5 23 17.3 C25.5 18.4 25 22 22 22.7 C18.5 23.5 16 20.5 17 17 C18.2 13 23.5 12 27 14.5 C30.5 17 30.5 23 27 26'/%3E%3Cpath d='M8 27 C11 29 14 29.5 16.5 29' /%3E%3C/g%3E%3C/svg%3E");
}
.site-header, .site-footer {
  position: relative; overflow: hidden;
  background-color: var(--sand);
  background-image: var(--sand-grain), var(--sand-drift);
  background-size: 200px 200px, 900px 300px;
}
.site-header > .wrap, .site-footer > .wrap { position: relative; z-index: 1; }
.site-header::after, .site-footer::before, .site-footer::after {
  content: ""; position: absolute; pointer-events: none; background: center / contain no-repeat; opacity: .9;
}
.site-header::after { width: 26px; height: 26px; right: max(16px, calc(50% - 600px)); bottom: 6px; background-image: var(--shell-scallop); transform: rotate(-18deg); }
.site-footer::before { width: 30px; height: 30px; right: max(28px, calc(50% - 560px)); bottom: 22px; background-image: var(--shell-spiral); transform: rotate(24deg); }
.site-footer::after { width: 20px; height: 20px; right: max(70px, calc(50% - 512px)); bottom: 12px; background-image: var(--shell-scallop); transform: rotate(32deg); }

/* Dark mode: night on the same beach. The sand dims under a veil; the shells catch a little moonlight */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header, :root:not([data-theme="light"]) .site-footer {
    background-image: linear-gradient(rgba(18,19,24,.86), rgba(18,19,24,.86)), var(--sand-grain), var(--sand-drift);
    background-size: auto, 200px 200px, 900px 300px; background-color: #4a4a4c;
  }
  :root:not([data-theme="light"]) .site-header::after, :root:not([data-theme="light"]) .site-footer::before, :root:not([data-theme="light"]) .site-footer::after { opacity: .6; filter: invert(1) hue-rotate(180deg); }
}
:root[data-theme="dark"] .site-header, :root[data-theme="dark"] .site-footer {
  background-image: linear-gradient(rgba(18,19,24,.86), rgba(18,19,24,.86)), var(--sand-grain), var(--sand-drift);
  background-size: auto, 200px 200px, 900px 300px; background-color: #4a4a4c;
}
:root[data-theme="dark"] .site-header::after, :root[data-theme="dark"] .site-footer::before, :root[data-theme="dark"] .site-footer::after { opacity: .6; filter: invert(1) hue-rotate(180deg); }

/* About: two small ads, each to the Contact page */
.ads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.ad { display: grid; gap: 8px; align-content: start; padding: 18px 20px; border-radius: 14px; text-decoration: none;
  background: var(--bg); border: 1px solid var(--line); transition: border-color .25s, transform .25s; }
.ad h3 { font-size: 1.25rem; line-height: 1.15; }
.ad p { font-size: 0.92rem; line-height: 1.5; color: var(--text); }
.ad-cta { margin-top: 4px; font-weight: 600; font-size: 0.92rem; color: var(--accent); }
.ad:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (max-width: 520px) { .ads { grid-template-columns: minmax(0, 1fr); } }

/* Contact page */
.contact .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.contact h1 { font-size: clamp(3rem, 8vw, 6rem); line-height: 0.95; }
.contact h1 span { color: var(--accent); }
.contact-intro { display: grid; gap: 20px; justify-items: start; }
.contact-intro .lede { font-size: clamp(1.1rem, 1.8vw, 1.25rem); max-width: 28rem; }
.direct { display: grid; gap: 4px; padding-top: 20px; border-top: 1px solid var(--line); width: 100%; }
.direct a { color: var(--ink); font-weight: 600; font-size: 1.1rem; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.contact-form { display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.topics { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.topics legend { margin-bottom: 10px; }
.topics label { cursor: pointer; }
.topics input { position: absolute; opacity: 0; pointer-events: none; }
.topics span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 0.95rem; transition: all .2s; }
.topics input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.topics input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.field { display: grid; gap: 6px; }
.field input, .field textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 400 1rem var(--font-body); }
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.form-note { font-size: 0.85rem; color: var(--muted); }
.contact-form .btn { justify-self: start; cursor: pointer; font: inherit; }
@media (max-width: 860px) { .contact .wrap { grid-template-columns: minmax(0, 1fr); } }
