@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/archivo-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/archivo-latin-500-normal.woff2") format("woff2");
}

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f4f4f2;
  --color-text: #111111;
  --color-text-muted: #555a60;
  --color-border: #d9d9d6;
  --color-panel: #111111;
  --color-on-panel: #f2f2f0;
  --color-on-panel-muted: #b4b4b0;
  --color-focus: var(--color-text);

  --font-heading: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: var(--font-heading);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --max-width: 1000px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

a {
  color: var(--color-text);
  text-underline-offset: 0.2em;
}

strong {
  font-weight: 500;
}

[hidden] {
  display: none !important;
}

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

.projects-panel,
.pull-quote {
  --color-focus: #ffffff;
}

/* ---- Hero ---- */
.hero {
  --clear: 420px;
  padding: 3.5rem 1.5rem 1rem;
}

/* The stage lines up with the page container (nav, sections). It only widens
   and centres the copy when there are drawings to place beside it. */
.hero-stage {
  position: relative;
  max-width: calc(var(--max-width) - 3rem);
  margin: 0 auto;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: calc(var(--clear) * 2);
}

.hero-portrait {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.hero-name {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 38rem;
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--color-text);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

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

.button-primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.button-primary:hover {
  background: #333333;
}

/* Drawings flow after the actions on narrower screens. */
.hero-drawings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem;
  list-style: none;
  max-width: calc(var(--clear) * 2);
  margin: 2.5rem 0 0;
  padding: 0;
}

/* Up to three sit side by side so they don't push the projects far down. */
.hero-drawing {
  width: min(var(--w, 320px), calc((100% - 3rem) / 3));
}

.hero-drawing img {
  display: block;
  width: 100%;
  height: auto;
}

/* From 1280px the drawings sit in the side margins around the copy column:
   one centred on the left, two stacked on the right. */
@media (min-width: 1280px) {
  .hero {
    padding-block: 4.5rem 2rem;
  }

  .hero-stage.has-drawings {
    max-width: 1600px;
    min-height: 35rem;
  }

  .has-drawings .hero-copy {
    margin-inline: auto;
  }

  .hero-drawings {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    max-width: none;
    margin: 0;
    pointer-events: none;
  }

  .hero-drawing {
    position: absolute;
    width: min(var(--w, 320px), calc(50% - var(--clear) - 24px));
  }

  .hero-drawing[data-zone="left"] {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
  }

  .hero-drawing[data-zone="upper-right"] {
    right: 0;
    top: 0;
  }

  .hero-drawing[data-zone="lower-right"] {
    right: 0;
    bottom: 0;
  }
}

.reveal-word {
  display: inline-block;
  opacity: 0.25;
  transition: opacity 0.4s ease;
}

.in-view .reveal-word {
  opacity: 1;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.skip-link:focus {
  top: 1rem;
  outline-color: var(--color-bg);
  outline-offset: -4px;
}

main:focus {
  outline: none;
}

/* ---- Nav ---- */
.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 2rem;
  row-gap: 0.5rem;
  padding: 1rem max(1.5rem, calc((100% - var(--max-width)) / 2 + 1.5rem));
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav .wordmark {
  font-size: 0.875rem;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav-links a:hover {
  text-decoration: underline;
}

.site-nav-links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

@media (min-width: 640px) {
  .site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

/* ---- Sections ---- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section h2 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}

.page-header {
  padding-bottom: 0;
}

.page-header h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  margin: 0;
}

.pull-quote {
  background: var(--color-panel);
  color: var(--color-on-panel);
  text-align: center;
  padding: 5rem 1.5rem;
}

.pull-quote-mark {
  display: block;
  font-size: 4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-on-panel-muted);
}

.pull-quote-mark-close {
  transform: scaleX(-1);
}

.pull-quote-text {
  max-width: 700px;
  margin: 1rem auto 0;
  font-size: 1.6rem;
  font-weight: 500;
}

.about-facts {
  list-style: none;
  padding: 0;
  color: var(--color-text-muted);
}

.page-subtitle {
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

/* ---- Tag lists (interests) ---- */
.tag-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.tag {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* ---- Skills carousel ---- */
.skills-carousel {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 1rem 1rem 2rem;
  -webkit-overflow-scrolling: touch;
}

.skill-card {
  flex: 0 0 260px;
  scroll-snap-align: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.skill-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  background: var(--color-bg-alt);
}

.skill-card h3 {
  margin: 0 0 0.5rem;
}

.skill-card p {
  color: var(--color-text-muted);
  margin: 0;
}

/* ---- Selected projects (index.html) ---- */
.selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.selected-item {
  display: grid;
  grid-template-columns: 13.75rem 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

.selected-item:last-child {
  border-bottom: 1px solid var(--color-border);
}

.selected-item.no-image {
  grid-template-columns: 1fr;
}

.selected-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
}

.selected-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.selected-body p {
  max-width: 38rem;
  margin: 0;
}

.selected-body .tool-tags {
  margin-top: 0.75rem;
}

.selected-body .tool-tag,
.selected-body .tool-tag-sep {
  color: var(--color-text-muted);
}

.selected-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-top: 1rem !important;
}

.selected-link {
  font-weight: 500;
}

.selected {
  padding-bottom: 0;
}

/* ---- Projects ---- */
.projects-panel {
  background: var(--color-panel);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  color: var(--color-on-panel);
  display: flex;
  flex-direction: column;
}

.project-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
}

.project-card h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--color-on-panel-muted);
}

/* Optional project status, e.g. "In progress". Uses currentColor so it
   reads on both the dark project cards and the light home page list. */
.status-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  vertical-align: middle;
  white-space: nowrap;
  opacity: 0.8;
}

.tool-tags {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-tag {
  color: var(--color-on-panel-muted);
  font-size: 0.875rem;
}

.tool-tag-sep {
  color: var(--color-on-panel-muted);
  font-size: 0.875rem;
}

.project-link {
  align-self: flex-start;
  display: inline-block;
  margin-top: 1rem;
  font-weight: 500;
  color: var(--color-on-panel);
}

/* ---- Hobbies ---- */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.hobby-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  padding: 1.5rem;
}

.hobby-card img {
  display: block;
  width: calc(100% + 3rem);
  height: 160px;
  object-fit: cover;
  margin: -1.5rem -1.5rem 1rem;
}

.hobby-card h3 {
  margin: 0 0 0.25rem;
}

.hobby-duration {
  display: inline-block;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.hobby-card p {
  color: var(--color-text-muted);
  margin: 0;
}

.hobbies-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.hobbies-toggle-btn {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
}

.hobbies-toggle-btn.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.hobbies-table {
  width: 100%;
  border-collapse: collapse;
}

.hobbies-table th,
.hobbies-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.hobbies-table th {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ---- Awards ---- */
.awards-list {
  list-style: none;
  padding: 0;
}

.award-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.award-meta {
  color: var(--color-text-muted);
}

/* ---- Contact ---- */
.contact-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.contact-list a {
  font-weight: 500;
}

/* ---- Footer ---- */
.site-footer {
  width: calc(100% - 3rem);
  max-width: calc(var(--max-width) - 3rem);
  margin: 2rem auto 0;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-nav a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav a[aria-current="page"] {
  color: var(--color-text);
}

.footer-contact-list {
  margin: 0 0 1rem;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .hero {
    padding: 3.5rem 1rem 2.5rem;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .site-nav {
    padding-inline: 1rem;
  }

  .site-footer {
    width: calc(100% - 2rem);
  }

  .selected-item {
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .projects-panel {
    padding: 2rem 1.25rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-word {
    opacity: 1;
  }
}
