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

/* ---------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------- */
:root {
  --bg:          #0b0b0c;
  --bg-soft:     #111113;
  --surface:     #141416;
  --surface-2:   #18181b;
  --border:      #232327;
  --border-soft: #1c1c20;
  --text:        #ededef;
  --muted:       #9a9aa3;
  --faint:       #6b6b73;
  --accent:      #8b7cf6;
  --accent-soft: rgba(139, 124, 246, 0.14);

  --maxw: 640px;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------
   Base
   --------------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* subtle ambient glow, GPU-cheap radial gradients */
  background-image:
    radial-gradient(60rem 40rem at 50% -10%, rgba(139, 124, 246, 0.08), transparent 70%),
    radial-gradient(40rem 30rem at 100% 0%, rgba(80, 120, 255, 0.05), transparent 60%);
  background-attachment: fixed;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: #fff;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface-2);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  z-index: 10;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 8rem) 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vh, 5rem);
}

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero__mark {
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1.25rem;
  opacity: 0.9;
}

.hero__name {
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 0%, #c7c7cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__tagline {
  margin-top: 1rem;
  max-width: 34ch;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  color: var(--muted);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero__links {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: color 0.2s var(--ease),
              border-color 0.2s var(--ease),
              background 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.link__icon {
  display: inline-flex;
  color: var(--faint);
  transition: color 0.2s var(--ease);
}
.link:hover {
  color: #fff;
  background: var(--surface-2);
  border-color: #34343a;
  transform: translateY(-1px);
}
.link:hover .link__icon {
  color: var(--accent);
}

/* ---------------------------------------------------------------
   Section heading
   --------------------------------------------------------------- */
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------
   Projects
   --------------------------------------------------------------- */
.projects__grid {
  display: grid;
  gap: 0.75rem;
}

.card {
  position: relative;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease),
              background 0.25s var(--ease),
              transform 0.25s var(--ease);
}
.card:hover {
  border-color: var(--border);
  background: var(--surface-2);
  transform: translateY(-2px);
}

/* whole-card click target */
.card__link {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card__arrow {
  color: var(--faint);
  font-size: 1rem;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.card:hover .card__arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

.card__desc {
  margin-top: 0.5rem;
  font-size: 0.94rem;
  color: var(--muted);
  max-width: 52ch;
}

.card__tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}
.card__tags li {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--faint);
  padding: 0.2rem 0.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

/* placeholder cards read as "to be filled" */
.card[data-placeholder] .card__title::after {
  content: '·  placeholder';
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--faint);
}
.footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer a:hover {
  color: var(--text);
}
.footer__sep {
  opacity: 0.5;
}

/* ---------------------------------------------------------------
   Scroll reveal (progressive enhancement; see main.js)
   --------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* if JS is disabled, content must still show */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (min-width: 560px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ---------------------------------------------------------------
   Accessibility: respect reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
