/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --fg: #0d1223;
  --muted: #7b8399;
  --faint: #a4abbd;
  --accent: #1b4dff;
  --radius: 26px;
  --col: 600px;
  --press: 190ms;
  --ease: cubic-bezier(0.2, 0.75, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.page {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 72px 20px 96px;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  margin-bottom: 52px;
}

.header__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f8;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.07);
}

.header__name {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.header__tagline {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 14.5px;
}

.header__socials {
  display: flex;
  gap: 9px;
  margin-top: 5px;
}

/* A social link is the same glass key as a project, at small size.
   The face light and the wall bevels are folded into one box-shadow
   because the element carries no image of its own. */
.social {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: #8a92a6;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 242, 250, 0.9) 100%);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    inset 0 1.5px 1px rgba(255, 255, 255, 1),
    inset 0 -1.5px 2px rgba(255, 255, 255, 0.55),
    0 8px 14px -10px rgba(15, 23, 42, 0.32),
    0 2px 4px -3px rgba(15, 23, 42, 0.2);
  transition:
    transform var(--press) var(--ease),
    box-shadow var(--press) var(--ease),
    color var(--press) var(--ease);
}

.social svg { width: 16px; height: 16px; fill: currentColor; }

/* Pressed: the key seats against the page and its shadow collapses. */
.social:hover,
.social:focus-visible {
  transform: translateY(3px) scale(0.97);
  color: #5f6880;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 2px 4px -3px rgba(15, 23, 42, 0.3),
    0 1px 1px -1px rgba(15, 23, 42, 0.18);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 56px;
  text-align: center;
}

.footer__note {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
}

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

/* ---------- Project stack ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.project { display: block; }

/* The key is a slab of glass lying on a printed image. Three things sell
   it: light raking across the top face, bevelled walls at the edge, and a
   layered shadow holding it above the page. The image itself is never
   filtered, tinted, or blurred. */
.project__key {
  position: relative;
  aspect-ratio: 21 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  background: #eef2f8;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 28px 46px -26px rgba(15, 23, 42, 0.4),
    0 9px 18px -14px rgba(15, 23, 42, 0.28),
    0 2px 4px -2px rgba(15, 23, 42, 0.14);
  transition:
    transform var(--press) var(--ease),
    box-shadow var(--press) var(--ease);
}

.project__media,
.project__still {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder panel, used when a project has no image yet. Static. */
.project__still {
  background:
    radial-gradient(120% 90% at 20% 15%, var(--tint-a) 0%, transparent 62%),
    linear-gradient(140deg, var(--tint-b) 0%, #f7f9ff 100%);
}

/* The face: light caught by the top surface of the slab. */
.project__key::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.09) 33%, rgba(255, 255, 255, 0) 54%),
    linear-gradient(to top, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 28%);
  transition: opacity var(--press) var(--ease);
}

/* The walls: the thickness of the glass, read as bevels. */
.project__key::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    inset 0 4px 6px -6px rgba(255, 255, 255, 1),
    inset 0 -4px 6px -6px rgba(255, 255, 255, 0.5),
    inset 5px 0 8px -6px rgba(255, 255, 255, 0.85),
    inset -5px 0 8px -6px rgba(255, 255, 255, 0.85),
    inset 0 -10px 14px -6px rgba(20, 30, 60, 0.28);
  transition: box-shadow var(--press) var(--ease);
}

/* Label sits on white below the key, so contrast never depends on
   whatever the screenshot happens to contain. */
.project__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
  padding-left: 4px;
  min-width: 0;
}

.project__title {
  flex: none;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.project__subtitle {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- The press ---------- */
/* Pressed means the slab has travelled down and is now flat against the
   page, so its shadow collapses to a contact shadow and its bevels soften.
   The image underneath does not change in any way. */

.project:hover .project__key,
.project:focus-visible .project__key,
.project.is-pressed .project__key {
  transform: translateY(6px) scale(0.988);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    0 6px 12px -10px rgba(15, 23, 42, 0.45),
    0 2px 4px -3px rgba(15, 23, 42, 0.28),
    0 1px 1px -1px rgba(15, 23, 42, 0.18);
}

.project:hover .project__key::before,
.project:focus-visible .project__key::before,
.project.is-pressed .project__key::before {
  opacity: 0.7;
}

.project:hover .project__key::after,
.project:focus-visible .project__key::after,
.project.is-pressed .project__key::after {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 3px 5px -6px rgba(255, 255, 255, 0.85),
    inset 0 -3px 5px -6px rgba(255, 255, 255, 0.35),
    inset 0 -7px 10px -6px rgba(20, 30, 60, 0.24);
}

.social.is-pressed {
  transform: translateY(3px) scale(0.97);
  color: #5f6880;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 2px 4px -3px rgba(15, 23, 42, 0.3),
    0 1px 1px -1px rgba(15, 23, 42, 0.18);
}

/* The focus ring belongs to the whole link, not just the key. */
.project:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}

/* ---------- Reduced motion ---------- */
/* Nothing on the page moves on its own. The press still happens, because
   it is a direct response to input, but it changes instantly. */
@media (prefers-reduced-motion: reduce) {
  .project__key,
  .project__key::before,
  .project__key::after,
  .social {
    transition-duration: 1ms;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .page { padding: 48px 16px 72px; }

  .header { margin-bottom: 40px; }
  .header__avatar { width: 64px; height: 64px; }
  .header__name { font-size: 24px; }
  .header__tagline { font-size: 14px; }

  .stack { gap: 26px; }

  .project__key { aspect-ratio: 16 / 10; border-radius: 20px; }

  .project__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-top: 13px;
  }

  .project__title { font-size: 15px; }
  .project__subtitle { font-size: 12.5px; white-space: normal; }
}
