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

html {
  scroll-behavior: smooth;
}

:root {
  /* ---- accent -------------------------------------------------------
     Sampled from the orange gradient behind the avatar illustration:
     --accent-soft is the warm centre glow, --accent-deep the outer edge,
     --accent the mid-tone that carries the page. */
  --accent-soft: #f2a961;
  --accent: #e07b32;
  --accent-deep: #d9722c;
  --on-accent: #23120a;

  --bg: hsl(0, 0%, 91%);
  --bg-alt: hsl(0, 0%, 95%);
  --ink: hsl(0, 0%, 7%);
  --ink-muted: hsl(0, 0%, 42%);
  --card: hsl(0, 0%, 100%);
  --rule: hsl(0, 0%, 82%);

  --fs-display: clamp(2.75rem, 1.2rem + 6.4vw, 5.25rem);
  --fs-h2: clamp(2rem, 1.2rem + 3.2vw, 3.25rem);
  --fs-body: clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  --fs-small: 0.8125rem;

  --ff: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shell: min(1080px, 100% - 3rem);
  --nav-h: 4.5rem;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--ff);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

img,
svg {
  display: block;
  max-width: 100%;
}

section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
}

.section-label {
  text-align: center;
  color: var(--ink-muted);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ---------- nav ---------- */

.nav-wrap {
  position: sticky;
  top: 1rem;
  z-index: 20;
  width: var(--shell);
  margin-inline: auto;
  padding-top: 1rem;
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 34rem;
  margin-inline: auto;
  padding: 0.5rem 0.75rem;
  background-color: var(--card);
  border-radius: 10rem;
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.06), 0 8px 24px hsl(0 0% 0% / 0.06);
}

.brand {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 1.75rem;
  border-radius: 10rem;
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: 0.8125rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  margin: 0;
  padding-right: 0.5rem;
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
}

/* the little outlined circle poking out of the bar */
.nav-orb {
  position: absolute;
  top: -0.375rem;
  left: 50%;
  translate: 3.5rem 0;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background-color: var(--bg);
}

.nav-orb::after {
  content: "";
  position: absolute;
  top: -0.1875rem;
  left: 0.125rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--accent);
}

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

.hero {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  width: var(--shell);
  margin-inline: auto;
  padding-block: clamp(3.5rem, 10vw, 8rem);

  @media (min-width: 48em) {
    grid-template-columns: auto 1fr;
  }
}

.hero-photo {
  position: relative;
  isolation: isolate;
  width: clamp(11rem, 26vw, 15.5rem);
  aspect-ratio: 1;
  margin-inline: auto;

  /* 1 frames the image as shot. Raise it for a square, full-bleed
     illustration so the crop closes in on the figure and the background
     falls outside the circle. --photo-focus picks the anchor point:
     lower percentages hold the head as it zooms. --photo-crop-y slides
     the square crop along the source: 0% takes the window from the very
     top, which leaves the most headroom above the head. */
  --photo-zoom: 1;
  --photo-focus: 50%;
  --photo-crop-y: 0%;
}

.photo-frame {
  width: 100%;
  height: 100%;
  padding: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
}

.photo-crop {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.photo-crop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--photo-crop-y);
  scale: var(--photo-zoom);
  transform-origin: 50% var(--photo-focus);
  filter: contrast(1.04);
}

/* accent circle tucked behind the portrait, peeking out bottom-right */
.blob {
  position: absolute;
  z-index: -1;
  right: -0.25rem;
  bottom: 1rem;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-image: radial-gradient(
    circle at 32% 28%,
    var(--accent-soft),
    var(--accent-deep)
  );
}

.hero-text {
  text-align: center;

  @media (min-width: 48em) {
    text-align: left;
  }
}

.hero h1 {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
}

.lede {
  margin-top: 1.25rem;
  max-width: 30ch;
  margin-inline: auto;
  font-style: italic;
  color: var(--ink-muted);

  @media (min-width: 48em) {
    margin-inline: 0;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background-color: hsl(0 0% 0% / 0.05);
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

.dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background-color: var(--accent);
}

/* ---------- about ---------- */

.about {
  display: grid;
  gap: clamp(3rem, 7vw, 5rem);
  align-items: center;
  width: var(--shell);
  margin-inline: auto;
  border-top: 1px solid var(--rule);

  @media (min-width: 48em) {
    grid-template-columns: 1fr 1fr;
  }
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--accent);
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-copy p + p {
  margin-top: 1.25rem;
}

.about-art {
  position: relative;
  display: grid;
  justify-items: center;
  color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 20rem;
}

.chip {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 0.625rem;
  background-color: var(--card);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9375rem;
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.08), 0 10px 20px hsl(0 0% 0% / 0.08);
}

.chip-1 {
  rotate: -8deg;
}
.chip-2 {
  rotate: 6deg;
}
.chip-3 {
  rotate: -3deg;
}
.chip-4 {
  rotate: 9deg;
}
.chip-5 {
  rotate: -6deg;
}
.chip-6 {
  rotate: 4deg;
}

.squiggle {
  width: 3.5rem;
  margin-top: 2rem;
}

.scrawl {
  margin-top: 0.25rem;
  font-style: italic;
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

/* ---------- work ---------- */

.work {
  width: var(--shell);
  margin-inline: auto;
  border-top: 1px solid var(--rule);
}

.grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

.grid-3 {
  @media (min-width: 48em) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-2 {
  margin-top: clamp(2rem, 4vw, 3rem);

  @media (min-width: 48em) {
    grid-template-columns: repeat(2, 1fr);
    width: min(100%, 42rem);
    margin-inline: auto;
  }
}

.polaroid {
  padding: 0.75rem 0.75rem 1.25rem;
  background-color: var(--card);
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.08), 0 14px 28px hsl(0 0% 0% / 0.1);
  transition: rotate 0.25s ease, translate 0.25s ease;
}

.proj:nth-child(odd) .polaroid {
  rotate: -1.5deg;
}

.proj:nth-child(even) .polaroid {
  rotate: 1.5deg;
}

.proj:hover .polaroid {
  rotate: 0deg;
  translate: 0 -0.375rem;
}

.polaroid svg {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

.polaroid svg path {
  fill: none;
  stroke: hsl(0 0% 0% / 0.22);
  stroke-width: 2;
}

.polaroid svg rect:not(:first-child),
.polaroid svg circle {
  fill: hsl(0 0% 100% / 0.45);
  stroke: hsl(0 0% 0% / 0.18);
  stroke-width: 2;
}

.polaroid h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}

.polaroid .role {
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

.polaroid .year {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--ink-muted);
}

.desc {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 1rem;
}

.tags li {
  padding: 0.1875rem 0.5rem;
  border-radius: 0.25rem;
  background-color: hsl(0 0% 0% / 0.06);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ---------- stats ---------- */

.stats {
  background-color: var(--ink);
  color: var(--card);
}

.stats dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 5vw, 3rem);
  width: var(--shell);
  margin-inline: auto;
  text-align: center;

  @media (min-width: 48em) {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stats dt {
  font-size: clamp(2.5rem, 1rem + 5vw, 4.5rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.stats dd {
  margin: 0.75rem 0 0;
  font-size: var(--fs-small);
  color: hsl(0 0% 100% / 0.65);
}

/* ---------- blog ---------- */

.blog {
  background-color: var(--bg-alt);
}

.blog-card {
  width: var(--shell);
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 5rem) 1.5rem;
  border-radius: 0.75rem;
  background-color: var(--card);
  text-align: center;
}

.blog-icon {
  width: 2rem;
  margin-inline: auto;
  margin-bottom: 1.25rem;
  color: var(--accent-deep);
}

.blog-card h3 {
  font-size: 1.375rem;
  font-weight: 700;
}

.blog-card p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* ---------- tech ---------- */

.tech {
  background-color: var(--bg-alt);
  padding-top: 0;
}

.tech-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  width: var(--shell);
  margin-inline: auto;
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-align: center;
}

.tech-row li {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.tile {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  background-color: var(--ink);
  color: var(--card);
  font-size: 0.75rem;
  font-weight: 700;
  transition: background-color 0.2s ease;
}

.tile::before {
  content: attr(data-mark);
}

.tech-row li:hover .tile {
  background-color: var(--accent);
  color: var(--on-accent);
}

/* ---------- contact ---------- */

.contact {
  background-color: var(--ink);
  color: var(--card);
  padding-block: clamp(4rem, 9vw, 7.5rem) 2rem;
}

.contact-inner {
  width: var(--shell);
  margin-inline: auto;
}

.contact h2 {
  font-size: var(--fs-h2);
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.125rem;
  border-bottom: 1px solid hsl(0 0% 100% / 0.18);
  color: hsl(0 0% 100% / 0.85);
  transition: color 0.2s ease;
}

.links a:hover {
  color: var(--accent);
}

.arrow {
  transition: translate 0.2s ease;
}

.links a:hover .arrow {
  translate: 0.375rem 0;
}

.colophon {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem;
  border-top: 1px solid hsl(0 0% 100% / 0.14);
  text-align: center;
  font-size: var(--fs-small);
  color: hsl(0 0% 100% / 0.5);
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
