/* ==========================================================
   Stephen Boyle — portfolio
   Plain CSS port of the Lovable (React + Tailwind) build.
   ========================================================== */

/* ---------- Fonts (self-hosted, SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --bg: hsl(14 84% 56%);          /* coral/orange */
  --bg-accent: hsl(14 84% 52%);   /* button hover */
  --bg-muted: hsl(14 84% 48%);    /* 404 page */
  --fg: #000;

  --fg-80: rgb(0 0 0 / .8);
  --fg-75: rgb(0 0 0 / .75);
  --fg-65: rgb(0 0 0 / .65);
  --fg-60: rgb(0 0 0 / .6);
  --fg-50: rgb(0 0 0 / .5);
  --fg-40: rgb(0 0 0 / .4);
  --fg-15: rgb(0 0 0 / .15);
  --fg-10: rgb(0 0 0 / .1);
  --fg-05: rgb(0 0 0 / .05);

  --radius: .5rem;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;

  --ease-out: cubic-bezier(0, 0, .58, 1);   /* framer-motion "easeOut" */

  color-scheme: light;
}

/* ---------- Minimal reset (Tailwind preflight subset) ---------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--fg-15); }
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  letter-spacing: 0;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p { margin: 0; font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; padding: 0; cursor: pointer; }
strong { font-weight: 600; color: var(--fg); }
.italic { font-style: italic; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* ---------- Layout helpers ---------- */
.container { max-width: 80rem; margin-inline: auto; padding-inline: 2rem; }
.narrow    { max-width: 48rem; margin-inline: auto; padding: 6rem 2rem; }

.label {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--fg-60);
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.label--gap  { margin-top: 4rem; }
.label--wide { letter-spacing: .025em; }

.body-text { font-size: 17px; line-height: 1.75; font-weight: 500; color: var(--fg-75); }
.body-text--65 { color: var(--fg-65); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: hsl(14 84% 56% / .8);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--fg-10);
}
.nav__inner {
  display: flex;
  align-items: center;
  padding-block: 1.5rem;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
}
.nav__home { color: var(--fg-80); transition: color .2s cubic-bezier(.4, 0, .2, 1); }
.nav__home:hover { color: var(--fg); }
.nav__link { margin-left: 1.25rem; color: var(--fg-80); }
.nav__link--first { margin-left: auto; }
.nav__link:hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero { padding-top: 6rem; padding-bottom: 4rem; }
.hero__title-wrap { position: relative; margin-bottom: 4rem; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 1.1;
}
.hero__blurb {
  max-width: 36rem;
  margin-top: 2rem;
  margin-left: auto;
  text-align: right;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 500;
  color: var(--fg-75);
}
/* The Tailwind build's responsive text sizes reset line-height to 1 */
@media (min-width: 640px)  { .hero__title { font-size: 3rem;   line-height: 1; } }
@media (min-width: 768px)  { .hero__title { font-size: 4.5rem; line-height: 1; }
                             .hero__blurb { font-size: 1.25rem; line-height: 1.75rem; } }
@media (min-width: 1024px) { .hero__title { font-size: 6rem;   line-height: 1; } }

/* ---------- Work ---------- */
.work { padding-block: 3rem; }
section[id] { scroll-margin-top: 6rem; }

/* The wrapper does the rounding: Safari won't reliably clip a <video>'s own corners */
.reel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--fg);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
}
.reel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--fg);
}

/* ---------- Carousel ----------
   The viewport has a fixed 16:9 box and each slide fills it absolutely,
   so an image's own size (or a failed load) can never change the layout. */
.carousel { position: relative; border-radius: var(--radius); outline: none; }
.carousel:focus-visible { box-shadow: 0 0 0 2px var(--fg); }
.carousel__viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.carousel__viewport.is-dragging { cursor: grabbing; }
.carousel__track { position: absolute; inset: 0; }
.carousel__slide {
  position: absolute;
  inset: 0;
  will-change: transform;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--fg-05);
}
.carousel__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}
.carousel__count {
  font-size: .875rem;
  line-height: 1.25rem;
  color: var(--fg-60);
  font-variant-numeric: tabular-nums;
}
.carousel__buttons { display: flex; gap: .5rem; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--fg-15);
  border-radius: calc(var(--radius) - 2px);
  background: var(--bg);
  transition: color .15s cubic-bezier(.4, 0, .2, 1), background-color .15s cubic-bezier(.4, 0, .2, 1);
}
.btn-icon:hover { background: var(--bg-accent); }
.btn-icon:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.btn-icon svg {
  width: 1rem; height: 1rem; flex-shrink: 0; pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Contact ---------- */
.contact { padding-block: 4rem; }
.contact__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 640px)  { .contact__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .contact__grid { grid-template-columns: 2fr 1fr 1fr; } }

.col-title { font-size: 1rem; line-height: 1.5rem; font-weight: 500; margin-bottom: 1rem; }
.link-list { display: flex; flex-direction: column; gap: .25rem; }
.link-list__a {
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--fg-75);
  transition: color .2s cubic-bezier(.4, 0, .2, 1);
}
.link-list__a:hover { color: var(--fg); }
.break { overflow-wrap: break-word; }

.contact__cta-wrap { display: flex; align-items: flex-start; }
@media (min-width: 640px) { .contact__cta-wrap { justify-content: flex-end; } }
.contact__cta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
  transition: opacity .2s cubic-bezier(.4, 0, .2, 1);
}
.contact__cta:hover { opacity: .7; }
.contact__arrow { font-size: 1.125rem; line-height: 1.75rem; }

/* ---------- Experience ---------- */
.exp-list { display: flex; flex-direction: column; gap: .25rem; }
.exp {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem;
  border-radius: var(--radius);
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
.exp:hover { background: var(--fg-05); }
.exp__company { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.exp__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .5rem;
  font-size: .875rem;
  line-height: 1.25rem;
}
.exp__date { color: var(--fg-50); font-weight: 500; }
.exp__dot  { color: var(--fg-50); }
.exp__role { color: var(--fg-65); font-weight: 500; }
.exp__desc { font-size: .875rem; line-height: 1.625; color: var(--fg-65); margin-top: .5rem; }

/* ---------- Skills / About ---------- */
.skills { display: flex; flex-direction: column; gap: 1.5rem; }
.skills__label { font-size: 1rem; line-height: 1.5rem; font-weight: 600; margin-bottom: .5rem; }
.about { display: flex; flex-direction: column; gap: 1.25rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--fg-10); margin-top: 8rem; }
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-block: 3rem;
}
@media (min-width: 768px) { .footer__inner { flex-direction: row; } }
.footer p { font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--fg-50); }

/* ==========================================================
   Motion (replaces framer-motion)
   Only applied when JS is running, so content is never hidden
   if the script fails to load.
   ========================================================== */
@keyframes nav-in  { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(30px); }  to { opacity: 1; transform: none; } }

.js .nav { animation: nav-in .5s var(--ease-out) both; }
.js .reveal-hero { animation: rise-in .8s var(--ease-out) var(--delay, 0s) both; }

.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Mirrors <MotionConfig reducedMotion="user">: keep fades, drop movement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @keyframes nav-in  { from { opacity: 0; } to { opacity: 1; } }
  @keyframes rise-in { from { opacity: 0; } to { opacity: 1; } }
  .js .reveal { transform: none; }
}
