/* ---------- Tokens ---------- */
:root {
  --void: #050708;
  --surface: #0a1013;
  --glass: rgba(13, 20, 23, 0.55);
  --border: #1a252b;
  --border-bright: #2c3e47;

  --ice: #638699;
  --ice-bright: #a8c4d4;
  --ice-pale: #d4e4ec;
  --ice-dim: #33454e;
  --ice-glow: rgba(99, 134, 153, 0.4);

  --text: #f3f6f7;
  --text-secondary: #8a9ba4;
  --text-tertiary: #4f6169;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1100px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

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

::selection { background: var(--ice-dim); color: var(--text); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ice-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Snowfall canvas ---------- */
#snow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Layout ---------- */
section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 7rem 1.5rem;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--ice-bright);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.ghost-num {
  position: absolute;
  top: 3.5rem;
  right: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 12vw, 9rem);
  color: transparent;
  -webkit-text-stroke: 1px var(--border-bright);
  line-height: 1;
  user-select: none;
  z-index: -1;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  background: rgba(5, 7, 8, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
}
.nav__dot { color: var(--ice-bright); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav__links > a:not(.nav__cta) {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.nav__links > a:not(.nav__cta):hover { color: var(--ice-pale); }

.nav__cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.nav__cta:hover {
  color: var(--void);
  border-color: var(--ice-bright);
  background: var(--ice-bright);
}

/* ---------- Button ---------- */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--void);
  background: var(--ice-bright);
  padding: 0.9rem 1.85rem;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:hover {
  background: var(--ice-pale);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px var(--ice-glow);
}

.btn--ghost {
  color: var(--ice-pale);
  background: transparent;
  border-color: var(--border-bright);
}
.btn--ghost:hover {
  color: var(--void);
  background: var(--ice-pale);
  border-color: var(--ice-pale);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
}

.hero__glass {
  width: 100%;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(2.5rem, 5vw, 4.5rem);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.2rem, 8.5vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
  background: linear-gradient(180deg, var(--text) 45%, var(--ice-bright) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__flake {
  color: var(--ice-bright);
  -webkit-text-fill-color: var(--ice-bright);
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.6em;
  vertical-align: super;
  animation: spin 8s linear infinite;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
  color: var(--text);
  margin-bottom: 0.75rem;
  max-width: 38ch;
}

.hero__line {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2.25rem;
  max-width: 44ch;
}
.hero__line a {
  color: var(--ice-bright);
  border-bottom: 1px solid var(--ice-dim);
}
.hero__line a:hover { border-color: var(--ice-bright); }

.hero__seal {
  position: relative;
  width: clamp(180px, 20vw, 240px);
  height: clamp(180px, 20vw, 240px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__seal img {
  width: 78%;
  height: 78%;
  object-fit: cover;
  image-rendering: pixelated;
  border-radius: 50%;
  border: 2px solid var(--ice-dim);
  position: relative;
  z-index: 2;
}
.seal-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--ice-dim);
}
.seal-ring--outer {
  inset: 0;
  animation: spin 22s linear infinite;
  border-style: dashed;
  opacity: 0.6;
}
.seal-ring--inner {
  inset: 10%;
  animation: spin 16s linear infinite reverse;
  opacity: 0.4;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 44px;
  background: var(--border);
  overflow: hidden;
}
.hero__scroll span {
  position: absolute;
  top: -44px; left: 0;
  width: 100%; height: 100%;
  background: var(--ice-bright);
  animation: scrollLine 2.6s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { top: -44px; }
  100% { top: 44px; }
}

/* ---------- About ---------- */
.about__text {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--text-secondary);
  max-width: 66ch;
  line-height: 1.75;
}
.about__text::first-letter { color: var(--text); }
.about__text a,
.about__note a {
  color: var(--ice-bright);
  border-bottom: 1px solid var(--ice-dim);
}
.about__text a:hover,
.about__note a:hover { border-color: var(--ice-bright); }

.about__note {
  margin-top: 1.75rem;
  max-width: 62ch;
  color: var(--text-tertiary);
  font-size: 0.95rem;
  line-height: 1.7;
  padding-left: 1rem;
  border-left: 2px solid var(--ice-dim);
}

.spec-list .spec-row a {
  color: var(--ice-bright);
  border-bottom: 1px solid var(--ice-dim);
}
.spec-list .spec-row a:hover { border-color: var(--ice-bright); }

/* ---------- Specialize ---------- */
.spec-list {
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 1.6fr;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--border);
  transition: padding-left 0.3s ease, border-color 0.3s ease;
}
.spec-list .spec-row:last-child { border-bottom: 1px solid var(--border); }
.spec-row:hover {
  padding-left: 0.75rem;
  border-color: var(--border-bright);
}

.spec-row__index {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ice-dim);
  transition: color 0.3s ease;
}
.spec-row:hover .spec-row__index { color: var(--ice-bright); }

.spec-row h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}

.spec-row p {
  color: var(--text-tertiary);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Work ---------- */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.work-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.work-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--ice);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s ease;
}
.work-item:hover {
  border-color: var(--border-bright);
  transform: translateX(4px);
}
.work-item:hover::before { transform: scaleY(1); }

.work-item__head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.work-item__head h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ice-bright);
  border: 1px solid var(--ice-dim);
  border-radius: 3px;
  padding: 0.2rem 0.55rem;
}

.work-item p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 68ch;
}
.work-item a {
  color: var(--ice-bright);
  border-bottom: 1px solid var(--ice-dim);
}
.work-item a:hover { border-color: var(--ice-bright); }

/* ---------- Contact ---------- */
.contact__heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 2.75rem;
  letter-spacing: -0.01em;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.contact-card:hover {
  border-color: var(--ice-dim);
  background: #0d1417;
  transform: translateY(-3px);
}

.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ice-bright);
  text-transform: uppercase;
}
.contact-card__value { font-size: 1rem; color: var(--text); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__glass {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2.25rem 1.75rem;
  }
  .hero__line, .hero__title { max-width: none; margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .hero__seal { order: -1; margin-bottom: 0.5rem; }
  .spec-row { grid-template-columns: 2rem 1fr; }
  .spec-row p { grid-column: 2; }
  .ghost-num { top: 2.5rem; font-size: clamp(3rem, 18vw, 5rem); }
  .about__note { text-align: left; }
}

@media (max-width: 480px) {
  .nav__cta { padding: 0.5rem 0.9rem; font-size: 0.72rem; }
  .nav__links > a:not(.nav__cta) { display: none; }
  section { padding: 5rem 1.25rem; }
  .work-item { padding: 1.5rem 1.5rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__flake, .seal-ring, .hero__scroll span { animation: none; }
  #snow { display: none; }
}
