/* williamwnekowicz.com
   Quiet editorial portfolio. One family (Archivo variable) in two voices:
   expanded caps for display, normal width for body. Deep olive ink carries
   the brand on a pure white surface; dark mode inverts to bone on near-black.
   Motion: one page-load choreography in the hero, small scroll fades after.
   All pre-animation states are gated on html.anim, so no-JS, reduced motion,
   and ?still renders are complete and at rest. */

/* ---------------------------------------------------------------- tokens */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-var.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --ink: #1e2018;
  --ink: oklch(0.24 0.015 120);
  --brand: #2e3806;
  --brand: oklch(0.32 0.07 120);
  --accent: #414e17;
  --accent: oklch(0.4 0.08 122);
  --muted: #54574b;
  --muted: oklch(0.45 0.02 120);
  --line: #dddfd9;
  --line: oklch(0.9 0.008 120);
  --field: #f6f7f4;
  --field: oklch(0.975 0.004 120);
  --on-brand: #ffffff;
  /* Grounding shadow under the cut-out head. Soft, olive-tinted, cast down. */
  --head-shadow: 0 24px 46px oklch(0.30 0.05 120 / 0.24);

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease: cubic-bezier(0.45, 0.05, 0.35, 1);

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b07;
    --bg: oklch(0.145 0.008 120);
    --ink: #e7e9e2;
    --ink: oklch(0.93 0.01 120);
    --brand: #bccc99;
    --brand: oklch(0.82 0.07 122);
    --accent: #b1c887;
    --accent: oklch(0.8 0.09 124);
    --muted: #9da093;
    --muted: oklch(0.7 0.02 120);
    --line: #2d2f28;
    --line: oklch(0.3 0.012 120);
    --field: #131410;
    --field: oklch(0.19 0.01 120);
    --on-brand: #0a0b07;
    --on-brand: oklch(0.145 0.008 120);
    /* On near-black, a dark neutral shadow would vanish; deepen it below the
       surface so the head still reads as grounded, not floating. */
    --head-shadow: 0 24px 46px oklch(0.08 0.012 120 / 0.55);
  }
}

/* ---------------------------------------------------------------- base */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

::selection {
  background: var(--brand);
  color: var(--on-brand);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
  transition: top 200ms var(--ease-out);
}

.skip:focus-visible {
  top: 0.75rem;
}

/* Links: hairline underline that recedes right, then redraws from the left. */

a {
  color: inherit;
}

.site-nav a,
.hero-social a,
.contact-alt a,
.foot-social a {
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left calc(100% - 0.1em);
}

@media (hover: hover) and (pointer: fine) {
  .hero-social a,
  .contact-alt a,
  .foot-social a {
    transition: color 200ms var(--ease);
  }

  .hero-social a:hover,
  .contact-alt a:hover,
  .foot-social a:hover {
    color: var(--brand);
    animation: underline-redraw 450ms var(--ease-out) forwards;
  }
}

@keyframes underline-redraw {
  0% {
    background-position: right calc(100% - 0.1em);
    background-size: 100% 1px;
  }
  45% {
    background-position: right calc(100% - 0.1em);
    background-size: 0% 1px;
  }
  55% {
    background-position: left calc(100% - 0.1em);
    background-size: 0% 1px;
  }
  100% {
    background-position: left calc(100% - 0.1em);
    background-size: 100% 1px;
  }
}

/* The period as brand mark: one olive dot wherever the voice pauses. */

.dot {
  color: var(--accent);
}

/* ---------------------------------------------------------------- header */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 82rem;
  margin: 0 auto;
  padding: 1.375rem var(--gutter);
}

.wordmark {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  background-size: 0% 1px;
  transition: background-size 300ms var(--ease-out);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background-size: 100% 1px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 5rem) var(--gutter) clamp(4rem, 9vh, 7rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.hero-name {
  font-size: clamp(2.4rem, 6.5vw + 0.25rem, 6rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero-name .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}

.hero-name .line-inner {
  display: block;
}

.hero-rule {
  height: 2px;
  background: var(--brand);
  margin: clamp(1.5rem, 3.5vh, 2.5rem) 0;
  transform-origin: left center;
}

.tagline {
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 550;
  letter-spacing: -0.015em;
}

.identity {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.4rem;
  row-gap: 0.25rem;
  margin-top: 1.125rem;
  max-width: 40rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* A quiet middot between each role, set in the gap. Muted, not accent, so it
   reads as an editorial separator and does not compete with the brand dot. */
.identity span:not(:last-child)::after {
  content: "\00B7";
  margin-left: 1.4rem;
  color: var(--muted);
  opacity: 0.5;
}

.hero-social {
  display: flex;
  gap: 2rem;
  margin-top: clamp(1.75rem, 4vh, 3rem);
}

.hero-social a {
  font-weight: 600;
  font-size: 1rem;
}

.arrow {
  display: inline-block;
  margin-left: 0.3em;
  font-size: 0.8em;
  color: var(--accent);
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hero-social a:hover .arrow {
    transform: translate(0.12em, -0.12em);
  }
}

.hero-portrait {
  margin: 0;
}

/* Cursor-follow head: a low-poly render of the same face cut out on transparent
   alpha. One <img> whose src main.js §3 swaps to the orientation nearest the
   pointer (all nine preloaded), plus a soft perspective tilt toward the cursor,
   so the head turns to follow you around the page. Every pose is registered to
   one neck pivot at a uniform head size, so it turns in place. No JS /
   reduced-motion / touch / ?still rest on the forward-facing centre pose. */
.head {
  position: relative;
  width: 100%;
  transform: translateZ(0);
  /* Poses are registered to the base of the neck, so pivot the whole head there:
     it turns and tilts on one fixed point instead of swinging about its centre. */
  transform-origin: 50% 80%;
  will-change: transform;
  filter: drop-shadow(var(--head-shadow));
}

.head-img {
  display: block;
  width: 100%;
  height: auto;
  /* The crop clips the shoulders with a straight edge; dissolve just the very
     bottom so it reads as a portrait fading out, not a cropped box. */
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}

/* ---------------------------------------------------------------- sections */

.section {
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7.5rem) var(--gutter) 0;
}

.section:last-of-type {
  padding-bottom: clamp(5rem, 12vh, 9rem);
}

.section-rule {
  height: 1px;
  background: var(--line);
  transform-origin: left center;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 6rem);
  padding-top: clamp(2.5rem, 5vh, 4rem);
}

.section h2 {
  font-size: clamp(1.75rem, 3vw, 2.625rem);
  font-weight: 750;
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--brand);
}

/* Previously: an editorial list, not cards. */

.role-entry + .role-entry {
  border-top: 1px solid var(--line);
  margin-top: 2.25rem;
  padding-top: 2.25rem;
}

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
}

.role-entry h3 {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 720;
  font-stretch: 118%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.role-title {
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--muted);
}

.role-desc {
  margin-top: 0.625rem;
  max-width: var(--measure);
  color: var(--muted);
}

.edu {
  margin-top: 3rem;
  max-width: var(--measure);
  color: var(--muted);
}

/* Contact */

.contact-lead {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 550;
  letter-spacing: -0.01em;
  max-width: 46ch;
  text-wrap: balance;
}

.contact-form {
  margin-top: 2.5rem;
  max-width: 36rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field + .field {
  margin-top: 1.5rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
}

.field input,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.75rem 0.875rem;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit {
  margin-top: 1.75rem;
  font: inherit;
  font-weight: 650;
  color: var(--on-brand);
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 0;
  padding: 0.8125rem 2.25rem;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms var(--ease), border-color 200ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .submit:hover {
    background: var(--accent);
    border-color: var(--accent);
  }
}

.submit:active {
  transform: scale(0.97);
}

.submit:disabled {
  cursor: default;
  opacity: 0.65;
  transform: none;
}

.submit-label {
  display: inline-block;
  transition: filter 200ms var(--ease), opacity 200ms var(--ease);
}

.submit:disabled .submit-label {
  filter: blur(2px);
  opacity: 0.7;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9375rem;
  min-height: 1.5em;
  color: var(--muted);
}

.form-status.ok {
  color: var(--brand);
  font-weight: 600;
}

.form-status.err {
  color: var(--ink);
  font-weight: 600;
}

.contact-alt {
  margin-top: 2.5rem;
  max-width: var(--measure);
  color: var(--muted);
}

/* ---------------------------------------------------------------- footer */

.site-foot {
  border-top: 1px solid var(--line);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2.5rem;
  max-width: 82rem;
  margin: 0 auto;
  padding: 1.75rem var(--gutter);
  font-size: 0.875rem;
  color: var(--muted);
}

.foot-social {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

/* ---------------------------------------------------------------- motion
   Everything below only runs when main.js sets html.anim (JS present, no
   reduced-motion preference, no ?still). The base states above are the
   finished, at-rest design, so no-JS and headless renders never ship blank. */

.anim .hero-name .line-inner {
  transform: translateY(110%);
  animation: line-rise 700ms var(--ease-out) forwards;
}

.anim .hero-name .line:nth-child(2) .line-inner {
  animation-delay: 90ms;
}

@keyframes line-rise {
  to {
    transform: translateY(0);
  }
}

.anim .hero-rule {
  transform: scaleX(0);
  animation: rule-draw 800ms var(--ease-out) 260ms forwards;
}

@keyframes rule-draw {
  to {
    transform: scaleX(1);
  }
}

.anim .tagline,
.anim .identity,
.anim .hero-social {
  opacity: 0;
  transform: translateY(14px);
  animation: fade-rise 600ms var(--ease-out) forwards;
}

.anim .tagline {
  animation-delay: 380ms;
}

.anim .identity {
  animation-delay: 460ms;
}

.anim .hero-social {
  animation-delay: 540ms;
}

.anim .hero-portrait {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
  animation: portrait-develop 760ms var(--ease-out) 160ms forwards;
}

@keyframes fade-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portrait-develop {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Scroll reveals: a small fade with a 14px rise, staggered by --i. */

.anim [data-reveal] {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 550ms var(--ease-out), translate 550ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.anim [data-reveal].in {
  opacity: 1;
  translate: 0 0;
}

.anim .section-rule[data-reveal] {
  opacity: 1;
  translate: none;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-out);
}

.anim .section-rule[data-reveal].in {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .anim .hero-name .line-inner,
  .anim .hero-rule,
  .anim .tagline,
  .anim .identity,
  .anim .hero-social,
  .anim .hero-portrait {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .anim [data-reveal],
  .anim .section-rule[data-reveal] {
    opacity: 1;
    translate: none;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 799px) {
  .hero {
    padding-top: 1.25rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero-portrait {
    order: -1;
    max-width: 17rem;
  }

  .section-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .role-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .foot-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }

  .foot-social {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
