/* ==========================================================
   laurajoycedavis.com — simple site
   Change colors and fonts here, in :root.
   ========================================================== */

:root {
  --bg: #ffffff;
  --ink: #1f1c1a;
  --soft: #6d675f;
  --faint: #a39d92;
  --hair: #e8e4dd;
  --accent: #4f3b86;   /* violet, from the Narrative Podcasts logo */

  --display: "Instrument Serif", "Times New Roman", serif;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;

  --gutter: clamp(20px, 6vw, 96px);
  --max: 1240px;

  /* Watercolor circles from the Narrative Podcasts logo */
  --tex-violet: url("../images/dot-violet.jpg");
  --tex-blue: url("../images/dot-blue.jpg");
  --tex-green: url("../images/dot-green.jpg");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1rem + .2vw, 1.18rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 7vw, 6rem); line-height: 1; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; }
h3 { font-size: 1.6rem; line-height: 1.1; }
em { font-style: italic; color: var(--accent); }
p { margin: 0 0 1em; text-wrap: pretty; }

.label {
  font: 500 .7rem var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}
.muted { color: var(--soft); }

/* Three watercolor dots */
.dots { display: inline-flex; gap: .3em; vertical-align: middle; }
.dot { width: .7em; height: .7em; border-radius: 50%; background: var(--tex-violet) center / cover; display: inline-block; }
.dot.blue { background-image: var(--tex-blue); }
.dot.green { background-image: var(--tex-green); }

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

.site-header .wrap {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px 32px;
  padding-top: 32px; padding-bottom: 32px;
}
.logo { font-family: var(--display); font-size: 1.5rem; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.logo .dots { font-size: .5rem; }
.nav { display: flex; gap: clamp(20px, 3vw, 40px); }
.nav a {
  font: 500 .72rem var(--sans); letter-spacing: .17em; text-transform: uppercase;
  color: var(--soft); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }

/* ---------- Page intro ---------- */

.intro { padding: clamp(48px, 9vw, 120px) 0 clamp(48px, 7vw, 96px); }
.intro p.lede { font-size: 1.25em; line-height: 1.45; max-width: 34ch; color: var(--soft); margin-top: 28px; }

section { padding-bottom: clamp(72px, 10vw, 140px); }

/* ---------- Portfolio grid ---------- */
/* Each piece is one <article class="piece"> — copy one to add more. */

.portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: clamp(36px, 4vw, 56px) clamp(20px, 2.4vw, 32px);
}
.piece .art {
  position: relative; aspect-ratio: 1; overflow: hidden; background: #f2f0ec; margin-bottom: 18px;
}
.piece .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.piece:hover .art img { transform: scale(1.03); }
.piece h3 { margin-bottom: 6px; }
.piece h3 a { text-decoration: none; }
.piece .role { font: .78rem/1.6 var(--sans); color: var(--faint); margin-bottom: 10px; }
.piece p { color: var(--soft); font-size: .95em; }

/* Square painted with Laura's watercolor, for work without cover art */
.painted {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10%;
  background: var(--tex-violet) center / cover; color: #fff;
  font-family: var(--display); font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1;
}
.painted.blue { background-image: var(--tex-blue); }
.painted.green { background-image: var(--tex-green); }

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.about .photo { margin: 0; }
.about .photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about .photo figcaption { margin-top: 12px; }
.about h2 { margin-bottom: 28px; }
.about ul { padding-left: 1.1em; color: var(--soft); }
.about li { margin-bottom: .4em; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } .about .photo { max-width: 420px; } }

/* ---------- Contact ---------- */

.email { font-family: var(--display); font-style: italic; font-size: clamp(1.6rem, 5vw, 3.4rem); overflow-wrap: anywhere; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 28px; max-width: 720px; margin-top: 56px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; }
.form input, .form textarea {
  width: 100%; font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--faint); padding: 10px 0; border-radius: 0;
}
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; font: 500 .72rem var(--sans); letter-spacing: .16em; text-transform: uppercase;
  padding: 15px 26px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 40px; font: .8rem var(--sans); }

/* ---------- Audio player (draws the real waveform) ---------- */

.player { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.player button {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent center / cover; color: var(--ink);
  cursor: pointer; display: grid; place-items: center;
}
.player button:hover, .player.playing button { background-image: var(--tex-violet); border-color: transparent; color: #fff; }
.player button svg { width: 11px; height: 11px; fill: currentColor; }
.player button .i-play { margin-left: 2px; }
.player canvas { flex: 1; min-width: 0; height: 34px; cursor: pointer; }
.player .time { font: .7rem var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; min-width: 2.8em; text-align: right; }

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

.site-footer .wrap {
  border-top: 1px solid var(--hair); padding-top: 32px; padding-bottom: 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font: .72rem var(--sans); letter-spacing: .06em; color: var(--faint);
}
.site-footer a { color: var(--faint); }

/* ==========================================================
   Gallery layout (inspired by a portfolio wall):
   centered name, a grid of large tiles, one page per project.
   ========================================================== */

.masthead { text-align: center; padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); }
.masthead h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.masthead p { margin: 14px 0 0; color: var(--soft); font-style: italic; }
.masthead .dots { font-size: .55rem; margin-top: 22px; }

.site-header.slim .wrap { justify-content: flex-end; }

/* The tile grid — copy one <a class="tile"> to add a project */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, .8vw, 12px);
  padding: 0 clamp(6px, .8vw, 12px) clamp(72px, 10vw, 140px);
  max-width: 1600px; margin: 0 auto;
}
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }

.tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: #f2f0ec; text-decoration: none; color: #fff; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.04); }
.tile .painted { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.tile:hover .painted { transform: scale(1.04); }
.tile .logo-tile { position: absolute; inset: 0; display: grid; place-items: center; padding: 14%; background: #fff; border: 1px solid var(--hair); }
.tile .logo-tile img { height: auto; object-fit: contain; }
.tile-cap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
  padding: 12%; text-align: center;
  background: rgba(31, 28, 26, .58);
  opacity: 0; transition: opacity .4s ease;
}
.tile-cap strong { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.05; }
.tile-cap span { font: 500 .66rem var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: none) {
  .tile-cap { opacity: 1; justify-content: flex-end; align-items: flex-start; text-align: left; padding: 8%; background: linear-gradient(transparent 45%, rgba(31,28,26,.7)); }
  .tile-cap strong { font-size: 1.5rem; }
}

/* Project pages */
.project { max-width: 1040px; margin: 0 auto; padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(72px, 10vw, 140px); }
.project-head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.project-head .role { font: .8rem var(--sans); color: var(--faint); margin-top: 16px; letter-spacing: .04em; }
.project-body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.project-art { position: relative; aspect-ratio: 1; overflow: hidden; background: #f2f0ec; }
.project-art img { width: 100%; height: 100%; object-fit: cover; }
.project-art .logo-tile { position: absolute; inset: 0; display: grid; place-items: center; padding: 12%; background: #fff; border: 1px solid var(--hair); }
.project-art .logo-tile img { height: auto; object-fit: contain; }
.project-text p { color: var(--soft); }
.project-text .player { margin: 28px 0 8px; }
.project-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: clamp(40px, 6vw, 72px); }
.back { display: inline-block; margin-top: clamp(48px, 7vw, 88px); font: .78rem var(--sans); letter-spacing: .06em; }
@media (max-width: 760px) { .project-body { grid-template-columns: 1fr; } }

/* Fixes: painted squares fill edge to edge (zoom past the circle's white corners);
   logo tiles center their logo. */
.painted { background-size: 150%; background-position: center; }
.tile .logo-tile, .project-art .logo-tile { display: flex; align-items: center; justify-content: center; }
.tile .logo-tile img, .project-art .logo-tile img { width: 100%; height: auto; }

/* ==========================================================
   Bioluminescence + watercolor
   A night-sea hero on the home page; glowing touches on white.
   ========================================================== */

:root {
  --deep: #071a26;          /* night sea */
  --glow: #5ff2de;          /* sea-glass teal light */
  --glow-2: #6fc8ff;        /* blue light */
  --glow-ink: #0d8a8f;      /* readable teal for text on white */
}

/* A faint glowing line across the top of every page */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glow-2) 25%, var(--glow) 50%, #a48cff 75%, transparent);
  box-shadow: 0 0 12px 1px rgba(95, 242, 222, .55);
  opacity: .85;
}

/* ---------- The tide (home hero) ---------- */
.tide {
  position: relative; overflow: hidden; color: #eaf7f6;
  background: var(--deep) url("../images/sea-wash.svg") center / cover no-repeat;
  padding-bottom: clamp(90px, 12vw, 160px);
  margin-bottom: clamp(36px, 5vw, 64px);
  /* ragged watercolor bottom edge */
  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 139px) no-repeat, url("../images/edge-bottom.svg") bottom / 100% 140px no-repeat;
  mask: linear-gradient(#000, #000) top / 100% calc(100% - 139px) no-repeat, url("../images/edge-bottom.svg") bottom / 100% 140px no-repeat;
}
.tide::after { /* a soft luminous haze near the waterline */
  content: ""; position: absolute; inset: auto -10% 0 -10%; height: 55%; pointer-events: none;
  background: radial-gradient(60% 80% at 50% 100%, rgba(95, 242, 222, .22), transparent 70%);
}
.plankton { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.tide > *:not(.plankton) { position: relative; z-index: 1; }
.site-header.on-dark .nav a { color: rgba(234, 247, 246, .72); }
.site-header.on-dark .nav a:hover { color: #fff; }
.site-header.on-dark .nav a[aria-current="page"] { color: #fff; border-color: var(--glow); box-shadow: 0 6px 12px -8px var(--glow); }

.tide .masthead { padding-top: clamp(56px, 9vw, 130px); padding-bottom: 0; }
.tide .masthead .label { color: rgba(234, 247, 246, .6); margin-bottom: 26px; }
.tide .masthead h1 {
  font-size: clamp(3rem, 8vw, 7rem); color: #fff;
  text-shadow: 0 0 28px rgba(95, 242, 222, .35), 0 0 2px rgba(255, 255, 255, .4);
}
.tide .glow-line {
  max-width: 30ch; margin: 26px auto 0; font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5;
  color: rgba(234, 247, 246, .82); font-style: normal;
}
.tide .glow-line em { color: var(--glow); font-style: italic; text-shadow: 0 0 14px rgba(95, 242, 222, .7); }
.tide .dots { margin-top: 30px; font-size: .6rem; }
.tide .dot { box-shadow: 0 0 10px 1px rgba(95, 242, 222, .45); }

/* ---------- Glow on white ---------- */
.tile { transition: box-shadow .5s ease, transform .5s ease; }
.tile:hover, .tile:focus-visible {
  box-shadow: 0 0 0 1px rgba(95, 242, 222, .55), 0 18px 50px -18px rgba(31, 183, 168, .65), 0 0 40px -10px rgba(111, 200, 255, .55);
}
.tile-cap { background: linear-gradient(160deg, rgba(7, 26, 38, .55), rgba(7, 26, 38, .78)); }
.tile-cap strong { text-shadow: 0 0 18px rgba(95, 242, 222, .6); }

a:hover { color: var(--glow-ink); }
.nav a[aria-current="page"] { box-shadow: 0 6px 10px -8px var(--glow); }
.btn:hover { background: var(--deep); border-color: var(--deep); box-shadow: 0 0 0 1px rgba(95, 242, 222, .5), 0 0 22px -4px rgba(95, 242, 222, .7); }
.player button:hover, .player.playing button {
  background: var(--deep) url("../images/sea-wash.svg") center / 400%;
  box-shadow: 0 0 16px -2px rgba(95, 242, 222, .8);
}
.about .photo img, .project-art { box-shadow: 0 30px 60px -40px rgba(31, 183, 168, .55); }
.email:hover { color: var(--glow-ink); text-shadow: 0 0 18px rgba(95, 242, 222, .45); }
.form input:focus, .form textarea:focus { border-color: var(--glow-ink); box-shadow: 0 6px 10px -10px var(--glow); }

@media (prefers-reduced-motion: reduce) { .tile, .tile img { transition: none; } }

/* Refinements: painted shoreline overlay instead of a mask (Safari-safe), tighter spacing, upright label */
.tide { -webkit-mask: none; mask: none; margin-bottom: clamp(20px, 3vw, 40px); padding-bottom: clamp(110px, 13vw, 170px); }
.tide .shore {
  position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(70px, 9vw, 130px); z-index: 2; pointer-events: none;
  background: url("../images/edge-bottom.svg") bottom / 100% 100% no-repeat;
}
.tide .masthead .label { font-style: normal; }

/* ---------- Contact page in the night sea ---------- */
.tide-page { margin-bottom: 0; padding-bottom: clamp(120px, 14vw, 190px); min-height: 92vh; }
.tide-page .site-header .logo { color: #fff; }
.tide-page .intro { padding-top: clamp(40px, 7vw, 100px); padding-bottom: 0; }
.tide-page .label { color: rgba(234, 247, 246, .6); }
.tide-page h1 { color: #fff; text-shadow: 0 0 28px rgba(95, 242, 222, .35); }
.tide-page h1 em { color: var(--glow); text-shadow: 0 0 18px rgba(95, 242, 222, .7); }
.tide-page .intro p.lede { color: rgba(234, 247, 246, .78); }
.tide-page .email { color: #fff; text-decoration-color: rgba(95, 242, 222, .6); text-shadow: 0 0 22px rgba(95, 242, 222, .4); }
.tide-page .email:hover { color: var(--glow); }
.tide-page .form input, .tide-page .form textarea { color: #fff; border-color: rgba(234, 247, 246, .35); }
.tide-page .form input:focus, .tide-page .form textarea:focus { border-color: var(--glow); box-shadow: 0 8px 12px -10px var(--glow); }
.tide-page .btn { background: rgba(95, 242, 222, .12); border-color: var(--glow); color: #fff; box-shadow: 0 0 20px -6px rgba(95, 242, 222, .8); }
.tide-page .btn:hover { background: var(--glow); color: var(--deep); }
.tide-page .links a { color: rgba(234, 247, 246, .8); }
.tide-page .links a:hover { color: var(--glow); }
.tide-page + .site-footer .wrap { border-top: 0; }

/* ==========================================================
   Dark theme: the whole site in the night sea.
   Switched by the moon/sun button in the menu (js/main.js).
   ========================================================== */

html[data-theme="dark"] {
  --bg: #071a26;
  --ink: #eaf7f6;
  --soft: rgba(234, 247, 246, .74);
  --faint: rgba(234, 247, 246, .5);
  --hair: rgba(234, 247, 246, .12);
  --accent: var(--glow);
  --glow-ink: var(--glow);
  --wave-faint: rgba(234, 247, 246, .22);
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background: var(--deep) url("../images/sea-wash.svg") center top / cover fixed no-repeat;
}
html[data-theme="dark"] em { color: var(--glow); text-shadow: 0 0 14px rgba(95, 242, 222, .45); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2 { color: #fff; }
html[data-theme="dark"] .tide { background: transparent; }
html[data-theme="dark"] .tide .shore { display: none; }
html[data-theme="dark"] .piece .art, html[data-theme="dark"] .project-art, html[data-theme="dark"] .tile { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .tile .logo-tile, html[data-theme="dark"] .project-art .logo-tile { border-color: transparent; }
html[data-theme="dark"] .btn { background: rgba(95, 242, 222, .12); border-color: var(--glow); color: #fff; box-shadow: 0 0 20px -6px rgba(95, 242, 222, .8); }
html[data-theme="dark"] .btn:hover { background: var(--glow); color: var(--deep); }
html[data-theme="dark"] .player button { border-color: rgba(234, 247, 246, .6); color: #fff; }
html[data-theme="dark"] .form input, html[data-theme="dark"] .form textarea { color: #fff; }
html[data-theme="dark"] .about .photo img, html[data-theme="dark"] .project-art { box-shadow: 0 0 0 1px rgba(95, 242, 222, .25), 0 30px 70px -30px rgba(95, 242, 222, .45); }
html[data-theme="dark"] .project-gallery img { box-shadow: 0 0 0 1px rgba(95, 242, 222, .2); }

/* The switch */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; margin-left: 4px;
  display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--hair); background: transparent; color: var(--soft);
  transition: color .3s, border-color .3s, box-shadow .3s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--glow); box-shadow: 0 0 14px -4px var(--glow); }
.theme-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
.site-header.on-dark .theme-toggle { color: rgba(234, 247, 246, .8); border-color: rgba(234, 247, 246, .25); }
.nav { align-items: center; }

html[data-theme="dark"] .tide::after { display: none; }
