/* ---------- Tokens ---------- */

:root {
  --bg: #141414;
  --surface: #1d1d1d;
  --surface-hover: #252525;
  --border: #2c2c2c;
  --text: #f4f4f4;
  --text-muted: #8f8f8f;
  --text-dim: #3a3a3a;
  --card: #ececec;
  --card-text: #141414;

  --blue: #0a84ff;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
}

p {
  margin: 0;
}

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

.dock {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(29, 29, 29, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.dock a {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: var(--text-muted);
  font-size: 18px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.dock a:hover,
.dock a.is-active {
  background: var(--surface-hover);
  color: var(--text);
}

.dock a::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 4px 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.dock a:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Layout ---------- */

.layout {
  max-width: 1040px;
  margin: 0 auto;
  padding: 140px 32px 40px;
}

/* ---------- Header ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  padding-bottom: 96px;
  scroll-margin-top: 140px;
}

.hero-hello {
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 500;
}

.hero .display {
  margin-bottom: 28px;
}

.hero .lead a {
  color: var(--text);
  font-weight: 600;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, filter 0.2s;
}

.button:hover {
  background: var(--surface-hover);
}

.button--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue);
  filter: brightness(1.12);
}

.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* ---------- Sections ---------- */

.section {
  padding-bottom: 120px;
  scroll-margin-top: 110px;
}

.display {
  font-size: clamp(48px, 8vw, 92px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.display span {
  display: block;
  color: var(--text-dim);
}

.lead {
  max-width: 460px;
  color: var(--text-muted);
  font-size: 18px;
}

/* ---------- Project rows ---------- */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px;
  margin: 0 -14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.2s;
}

a.row:hover {
  background: var(--surface);
}

.row-thumb {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 20px;
  background: var(--surface);
}

.row-text {
  flex: 1;
  min-width: 0;
}

.row-text h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 22px;
}

.row-text p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 15px;
}

.row-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 20px;
  transition: color 0.2s, transform 0.2s;
}

a.row:hover .row-arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

.tag {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- Timeline ---------- */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.timeline li:first-child {
  border-top: none;
  padding-top: 0;
}

.timeline h3 {
  font-size: 24px;
}

.timeline h3 a {
  text-decoration: none;
}

.timeline h3 a:hover {
  text-decoration: underline;
}

.timeline .role {
  margin-top: 2px;
  color: var(--blue);
  font-weight: 500;
}

.timeline p:not(.role):not(.date) {
  margin-top: 10px;
  max-width: 560px;
  color: var(--text-muted);
}

.timeline .date {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Contact ---------- */

.contact-form {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  resize: vertical;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.contact-form button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--blue);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}

.contact-form button:hover {
  filter: brightness(1.12);
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .layout {
    padding: 112px calc(16px + 1em) 32px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 72px;
    scroll-margin-top: 112px;
  }

  .hero-photo {
    order: -1;
    width: 100%;
    max-width: 320px;
  }

  .section {
    padding-bottom: 88px;
  }
}

@media (max-width: 767px) {
  .hero {
    justify-items: center;
    text-align: center;
  }

  .hero-text {
    width: 100%;
  }

  .hero-photo {
    max-width: 480px;
  }

  .hero .lead {
    margin: 0 auto;
  }

  .hero-links {
    width: 100%;
  }

  .hero-links .button {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .row-thumb {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .row-text h3 {
    font-size: 19px;
  }
}
