/* ==========================================================
   Sam Whitfield — portfolio
   Styled with the El Jefe's Shisha Lounge design system (Night)
   ========================================================== */

:root {
  /* Neon pairs: bright outline + deep fill */
  --neon-blue: #0099ff;
  --neon-blue-deep: #00263f;
  --neon-pink: #ff0099;
  --neon-pink-deep: #3f0026;
  --neon-yellow: #ffcc00;
  --neon-yellow-deep: #3f3200;

  /* Night surfaces and ink */
  --surface-100: #333333;
  --surface-200: #262626;
  --ink: #ffffff;
  --ink-muted: #bdbdbd;

  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-24: 96px;

  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --stroke-neon: 4px;
  --stroke-line: 2px;

  --container: 1200px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--space-4)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; }
a { color: var(--neon-yellow); }
a:hover { color: #ffe066; }
:focus-visible { outline: var(--stroke-line) solid var(--ink); outline-offset: 3px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-8);
}
@media (max-width: 600px) { .container { padding-inline: var(--space-4); } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 20;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  background: var(--neon-yellow); color: var(--neon-yellow-deep); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Tone pairs ---------- */
.tone-blue   { --hi: var(--neon-blue);   --lo: var(--neon-blue-deep); }
.tone-pink   { --hi: var(--neon-pink);   --lo: var(--neon-pink-deep); }
.tone-yellow { --hi: var(--neon-yellow); --lo: var(--neon-yellow-deep); }

/* ---------- Neon titles (outlined signage type) ---------- */
.neon {
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--lo);
  -webkit-text-stroke: var(--stroke-neon) var(--hi);
  paint-order: stroke fill;
}
.neon--blue   { --hi: var(--neon-blue);   --lo: var(--neon-blue-deep); }
.neon--pink   { --hi: var(--neon-pink);   --lo: var(--neon-pink-deep); }
.neon--yellow { --hi: var(--neon-yellow); --lo: var(--neon-yellow-deep); }

.neon--display {
  font-size: clamp(64px, 12vw, 168px);
  line-height: 0.92;
  -webkit-text-stroke-width: clamp(3px, 0.5vw, 7px);
}
.neon--headline {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  -webkit-text-stroke-width: 3px;
}
.neon--title {
  font-size: 24px;
  line-height: 30px;
  font-weight: 800;
  -webkit-text-stroke-width: 2px;
}

/* ---------- Text styles ---------- */
.label {
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.label--yellow { color: var(--neon-yellow); }
.lead { font-size: 20px; line-height: 30px; max-width: 620px; }
.muted { color: var(--ink-muted); }
.caption { font-size: 12px; line-height: 16px; color: var(--ink-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-pill);
  border: var(--stroke-line) solid var(--hi);
  font: 700 13px/16px var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.btn--solid   { background: var(--hi); color: var(--lo); }
.btn--outline { background: var(--lo); color: var(--hi); }
.btn:hover    { filter: brightness(1.1); color: inherit; }
.btn--solid:hover   { color: var(--lo); }
.btn--outline:hover { color: var(--hi); }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  align-self: flex-start;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hi);
  background: var(--lo);
  color: var(--hi);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-100);
  border-bottom: var(--stroke-line) solid var(--surface-200);
}
.nav {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.nav__brand {
  font-size: 20px;
  line-height: 24px;
  font-weight: 900;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
}
.nav__brand:hover { color: var(--ink); }
.nav__menu {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav__link {
  display: inline-block;
  padding: 14px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: var(--stroke-line) solid transparent;
}
.nav__link:hover,
.nav__link.is-active { color: var(--neon-yellow); border-bottom-color: var(--neon-yellow); }
.nav__link--accent { color: var(--neon-yellow); }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: var(--stroke-line) solid var(--neon-yellow);
  border-radius: var(--radius-pill);
  background: var(--neon-yellow-deep);
  color: var(--neon-yellow);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) var(--space-4) var(--space-4);
    background: var(--surface-200);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__link { display: block; padding: var(--space-4) 0; }
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-12);
  padding-block: var(--space-24) 80px;
}
.hero__intro {
  flex: 1 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.hero__name { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.hero__name .neon--display { font-size: clamp(56px, 8vw, 112px); }

.panel {
  background: var(--surface-200);
  border-radius: var(--radius-md);
  padding: var(--space-8);
}
.facts {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.facts__list { display: flex; flex-direction: column; gap: var(--space-4); }
.facts__list div { display: flex; flex-direction: column; gap: var(--space-1); }
.facts__list dt {
  font-size: 12px; line-height: 16px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
}

/* ---------- Highlight strip ---------- */
.highlight { background: var(--neon-yellow-deep); }
.highlight__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-12);
}
.highlight__quote {
  flex: 1 1 520px;
  font-size: 28px;
  line-height: 36px;
  font-weight: 800;
  font-style: italic;
  color: var(--neon-yellow);
}

/* ---------- Sections ---------- */
.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-block: var(--space-12);
}
#skills { padding-top: var(--space-24); }
.section--last { padding-bottom: var(--space-24); }

.grid { display: grid; gap: var(--space-4); }
.grid--skills   { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--projects { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }

.card {
  background: var(--surface-200);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card__title {
  font-size: 24px;
  line-height: 30px;
  font-weight: 800;
  font-style: italic;
}

/* Jobs */
.job {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-12);
  padding: var(--space-8);
}
.job__meta { flex: 0 1 220px; display: flex; flex-direction: column; gap: var(--space-2); }
.job__body { flex: 1 1 480px; display: flex; flex-direction: column; gap: 12px; }
.job__company { font-weight: 700; }
.bullets {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--ink-muted);
}
@media (max-width: 600px) { .job { padding: var(--space-6); } }

/* Projects */
.project { padding: 0; overflow: hidden; gap: 0; }
.project__media {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.project__media img { width: 100%; height: 100%; object-fit: cover; }
.tone-bg-pink   { background: var(--neon-pink-deep); }
.tone-bg-blue   { background: var(--neon-blue-deep); }
.tone-bg-yellow { background: var(--neon-yellow-deep); }
.project__body {
  flex-grow: 1;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.project__body .caption { margin-top: auto; }

/* Education */
.timeline__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-12);
  padding-block: var(--space-6);
  border-top: var(--stroke-line) solid var(--surface-200);
}
.timeline__row:last-child { border-bottom: var(--stroke-line) solid var(--surface-200); }
.timeline__row > .label { flex: 0 1 220px; line-height: 28px; }
.timeline__row > div { flex: 1 1 480px; display: flex; flex-direction: column; gap: var(--space-1); }
.timeline__title { font-size: 20px; line-height: 28px; font-weight: 800; }

/* ---------- Contact ---------- */
.contact { background: var(--surface-200); }
.contact__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-12);
  padding-block: var(--space-24);
}
.contact__intro { flex: 1 1 480px; display: flex; flex-direction: column; gap: var(--space-6); }
.contact__intro .lead { max-width: 520px; }
.contact__details { flex: 0 1 380px; display: flex; flex-direction: column; gap: var(--space-4); }
.contact__email { font-size: 22px; line-height: 30px; font-weight: 800; word-break: break-all; }
.contact__phone { color: var(--ink); font-size: 18px; line-height: 28px; text-decoration: none; }
.contact__phone:hover { color: var(--neon-yellow); }
.copy-status { min-height: 16px; font-size: 12px; line-height: 16px; color: var(--neon-yellow); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-8);
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
}

/* ---------- Reveal on scroll (enabled by JS) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================
   Background art — lava blobs and psychedelic ripples
   Flat fills, hard edges, no gradients. SVGs are drawn by src/art.ts.
   ========================================================== */
.has-art { position: relative; isolation: isolate; --art-gap: var(--surface-100); }
.contact.has-art { --art-gap: var(--surface-200); }

.art-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.art {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  aspect-ratio: 1;
  animation: art-drift var(--dur, 22s) ease-in-out infinite alternate;
}
.art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.art--mobile { display: none; }

@keyframes art-drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(var(--dx, 0px), var(--dy, -40px)) rotate(var(--rot, 8deg)); }
}

@media (max-width: 760px) {
  .art { width: calc(var(--size) * 0.55); }
  .art--desktop { display: none; }
  .art--mobile { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .art { animation: none; }
}

/* ---------- Animated wavy edges ----------
   One 320px wave tile, scrolled sideways forever. The tile starts and ends
   at the same height, so the loop is seamless. */
:root { --wave-w: 320px; --wave-h: 36px; }

@keyframes wave-left  { from { background-position-x: 0; } to { background-position-x: calc(var(--wave-w) * -1); } }
@keyframes wave-right { from { background-position-x: 0; } to { background-position-x: var(--wave-w); } }
@keyframes wave-mask-right {
  from { -webkit-mask-position: 0 0, 0 var(--wave-h); mask-position: 0 0, 0 var(--wave-h); }
  to   { -webkit-mask-position: var(--wave-w) 0, 0 var(--wave-h); mask-position: var(--wave-w) 0, 0 var(--wave-h); }
}

/* Yellow strip: wave on top and (mirrored) on the bottom */
.highlight { position: relative; z-index: 2; }
.highlight::before,
.highlight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--wave-h);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='36' viewBox='0 0 320 36'%3E%3Cpath fill='%233f3200' d='M0 36V20C20 20 28 6 50 6S82 24 110 24 144 4 174 4 214 20 244 20 276 30 290 30 310 20 320 20V36z'/%3E%3C/svg%3E") repeat-x;
  background-size: var(--wave-w) var(--wave-h);
  pointer-events: none;
}
.highlight::before { bottom: calc(100% - 1px); animation: wave-left 14s linear infinite; }
.highlight::after  { top: calc(100% - 1px); transform: scaleY(-1); animation: wave-right 11s linear infinite; }

/* Contact block: wave on top */
.contact { position: relative; z-index: 1; }
.contact::before {
  content: "";
  position: absolute;
  z-index: -2; /* under the contact's own blobs */
  left: 0;
  right: 0;
  bottom: calc(100% - 1px);
  height: var(--wave-h);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='36' viewBox='0 0 320 36'%3E%3Cpath fill='%23262626' d='M0 36V20C20 20 28 6 50 6S82 24 110 24 144 4 174 4 214 20 244 20 276 30 290 30 310 20 320 20V36z'/%3E%3C/svg%3E") repeat-x;
  background-size: var(--wave-w) var(--wave-h);
  pointer-events: none;
  animation: wave-right 12s linear infinite;
}

/* The contact's blobs reach up into its wavy edge, cut to the same moving wave
   shape (mask: the wave tile on top, a solid block for the rest). */
.contact > .art-layer {
  top: calc(var(--wave-h) * -1);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='36' viewBox='0 0 320 36'%3E%3Cpath fill='%23000' d='M0 36V20C20 20 28 6 50 6S82 24 110 24 144 4 174 4 214 20 244 20 276 30 290 30 310 20 320 20V36z'/%3E%3C/svg%3E"), linear-gradient(#000 0 0);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='36' viewBox='0 0 320 36'%3E%3Cpath fill='%23000' d='M0 36V20C20 20 28 6 50 6S82 24 110 24 144 4 174 4 214 20 244 20 276 30 290 30 310 20 320 20V36z'/%3E%3C/svg%3E"), linear-gradient(#000 0 0);
  -webkit-mask-repeat: repeat-x, no-repeat;
  mask-repeat: repeat-x, no-repeat;
  -webkit-mask-size: var(--wave-w) var(--wave-h), 100% calc(100% - var(--wave-h));
  mask-size: var(--wave-w) var(--wave-h), 100% calc(100% - var(--wave-h));
  -webkit-mask-position: 0 0, 0 var(--wave-h);
  mask-position: 0 0, 0 var(--wave-h);
  animation: wave-mask-right 12s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .highlight::before, .highlight::after, .contact::before, .contact > .art-layer { animation: none; }
}
