/* ============================================================
   C.W. Denison Design Co. — styles
   Spec: docs/Spec_PortfolioSite.md
   §5 tokens · §3 shared chrome · §4 screens · §6 responsive
   ============================================================ */

/* ---------- Design tokens (§5) ---------- */

:root {
  /* Color */
  --brand-white: #ffffff;
  --page-blue: #0099ff;   /* About / Contact background field */
  --send-blue: #0194f6;   /* Contact Send button */
  --field-gray: #d9d9d9;  /* Contact message-area placeholder */
  --wash-black: #000000;  /* gradient wash stops */

  /* Type */
  --font: "Barlow", sans-serif;
  --track-display: 0.12em; /* brand, project title, menu items */
  --track-body: 0.04em;    /* body copy, Send label */

  /* Chrome position reference (Figma 1920×1080, §5.4) —
     margins from the viewport edges, not absolute coordinates */
  --edge-left: 59px;
  --edge-top: 63px;
  --edge-right: 72px;
}

/* ---------- Base ---------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: #000; /* fallback field behind imagery (§8) */
  color: var(--brand-white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Visible keyboard focus (§6 quality floor) */
:focus-visible {
  outline: 2px solid var(--brand-white);
  outline-offset: 3px;
}

/* ---------- Screens: the vertical grid (§2) ----------
   #screens is the scroll container; one full-viewport section
   per destination, snapping one destination per screen. */

.screens {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth; /* reset to auto under prefers-reduced-motion */
  scrollbar-width: none;   /* chrome IS the scroll indicator (left nav) */
}

.screens::-webkit-scrollbar {
  display: none;
}

.screen {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* Full-bleed imagery, always covering, centered (§6).
     Black field behind — also the §8 broken-image fallback. */
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Within-project gallery (§2, §4.2): a horizontal snap track,
   one full-viewport slide per image. Native swipe / trackpad;
   the arrows and ←/→ drive the same scroll position. */
.track {
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.track::-webkit-scrollbar {
  display: none;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- Gradient washes (§3) ---------- */

.wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Base left wash — Home + Project screens.
   (Figma uses a slightly diagonal ≈122° version on projects.) */
.wash--left {
  background: linear-gradient(
    122deg,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0) 55%
  );
}

/* Right wash — menu open, About, Contact (§3). */
.wash--right {
  display: none;
  background: linear-gradient(
    to left,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0) 55%
  );
}

body.menu-open .wash--right {
  display: block;
}

/* About/Contact carry their own right wash in the page background
   (below the copy — the global one would dim the content). */

/* On About/Contact the field is clean blue on the left —
   no left wash (§4.4 frames). */
body.page-open .wash--left {
  display: none;
}

/* Full-screen dim while the menu is open — matches the darkened
   Figma menu frame, and doubles as the tap-away close target. */
.menu-dim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 6;
  background: rgba(0, 0, 0, 0.5);
}

body.menu-open .menu-dim {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ---------- Shared chrome (§3) ----------
   One fixed overlay; only its interactive children take pointer
   events, so the imagery below stays swipeable. */

.chrome {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.chrome a,
.chrome button {
  pointer-events: auto;
}

/* Brand lockup — FIXED 32px on every breakpoint (§5, §6) */
.brand {
  position: absolute;
  top: var(--edge-top);
  left: var(--edge-left);
  display: block;
}

.brand__line {
  display: block;
  font-size: 32px;            /* fixed — never scales */
  line-height: 37px;          /* line 1 top 63 → line 2 top 100 */
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  white-space: nowrap;
}

.brand__line--1 {
  font-weight: 400; /* Barlow Regular */
}

.brand__line--2 {
  font-weight: 100; /* Barlow Thin */
}

/* Project title row: divider · title · arrows (§4.2).
   One flex row so the arrows always follow the title,
   whatever its length. Reference: divider left 353 top 65,
   title left 388 top 63, arrows top 70. */
.top-row {
  position: absolute;
  top: var(--edge-top);
  left: 353px;
  display: flex;
  align-items: flex-start;
}

.title-divider {
  width: 1px;
  height: 42px;
  margin-top: 2px; /* divider top 65 vs row top 63 */
  background: rgba(255, 255, 255, 0.55);
}

/* Project title — FIXED 32px on every breakpoint (§5, §6) */
.project-title {
  margin-left: 34px; /* divider 353+1 → title 388 */
  font-size: 32px;            /* fixed — never scales */
  font-weight: 700;           /* Barlow Bold */
  line-height: 37px;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Gallery arrows — 25×25 fixed, right of the title (§4.2) */
.arrows {
  display: flex;
  gap: 27px;
  margin-left: 33px;
  margin-top: 7px; /* arrows top 70 vs row top 63 */
}

.arrows button {
  width: 25px;
  height: 25px;
}

.arrows button:disabled {
  opacity: 0.35;
  cursor: default;
}

.arrows img {
  width: 25px;  /* fixed */
  height: 25px;
}

/* Hamburger — 25×25 fixed, top-right (§3). The white SVG is used
   as a mask over a paintable fill so the icon can turn blue in the
   menu-open / About / Contact states (Figma frames 4-276…10-2). */
.menu-btn {
  position: absolute;
  top: var(--edge-top);
  right: var(--edge-right);
  width: 25px;
  height: 25px;
}

.menu-btn__icon {
  display: block;
  width: 25px;  /* fixed */
  height: 25px;
  background: var(--brand-white);
  -webkit-mask: url("../assets/icons/icon_menu.svg") center / 25px 25px no-repeat;
  mask: url("../assets/icons/icon_menu.svg") center / 25px 25px no-repeat;
}

body.menu-open .menu-btn__icon,
body.page-open .menu-btn__icon {
  background: var(--page-blue);
}

/* Menu items — right-aligned beneath the hamburger (§4.3) */
.menu {
  position: absolute;
  top: 112px; /* hamburger bottom (63+25) + 24 */
  right: var(--edge-right);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}

.menu__item {
  font-size: 20px;
  font-weight: 500; /* Barlow Medium */
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Left navigator — home icon + one dot per project (§3) */
.left-nav {
  position: absolute;
  top: 50%;
  left: var(--edge-left);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px; /* dot spacing matched to the Figma frames */
  pointer-events: auto;
}

.left-nav__home img {
  width: 13px;  /* fixed */
  height: 12px;
}

.left-nav__dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--brand-white);
  border-radius: 50%;
}

.left-nav__dot.is-active {
  background: var(--brand-white);
}

/* Home icon "active" state — subtle, matches the dots' logic */
.left-nav__home {
  opacity: 0.75;
}

.left-nav__home.is-active {
  opacity: 1;
}

/* ---------- About / Contact pages (§4.4–4.5) ----------
   Fixed overlays on the blue field, above the screens (z 4),
   below the washes (z 5) so the right wash reads over them. */

.page {
  position: fixed;
  inset: 0;
  z-index: 4;
  /* Blue field + right wash underneath the copy (§4.4) */
  background:
    linear-gradient(to left, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 60%),
    var(--page-blue);
  overflow-y: auto;
}

/* Reference: body copy left 388, top 179, max width 1250 (§5.4) */
.page__inner {
  padding: 179px var(--edge-right) 80px 388px;
  max-width: calc(388px + 1250px);
  box-sizing: content-box;
}

.page__body {
  font-size: 32px;
  font-weight: 100; /* Barlow Thin */
  letter-spacing: var(--track-body);
  line-height: 1.2;
  max-width: 1250px;
}

.page__body p + p {
  margin-top: 38px; /* one blank line */
}

/* Left nav collapses to the home icon only (§4.4) */
body.page-open .left-nav__dot {
  display: none;
}

/* ---------- Contact form (§4.5) ----------
   Gray message area (ref 1022×457) holding name / email / message,
   then the Send pill (ref 313×62, radius 66). */

.contact-form {
  margin-top: 50px;
}

.contact-form__box {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1022px;
  height: 457px;
  padding: 24px 32px;
  background: var(--field-gray);
  border-radius: 4px;
}

.contact-form__field {
  width: 100%;
  padding: 14px 0;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: var(--track-body);
  color: #1a1a1a;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  outline-offset: 0;
}

.contact-form__field::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.contact-form__message {
  flex: 1;
  resize: none;
  border-bottom: 0;
}

.send-btn {
  display: block;
  width: 313px;
  height: 62px;
  margin-top: 49px;
  background: var(--send-blue);
  border-radius: 66px;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: var(--track-body);
  color: var(--brand-white);
}

.contact-form__status {
  margin-top: 24px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: var(--track-body);
  min-height: 1.4em;
}

/* ---------- Reduced motion (§6 quality floor) ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
