/* ============================================================
   alexxiy.top — minimal glass
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               "Inter", "Cantarell", "Noto Sans", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", "Cascadia Mono",
               "Liberation Mono", Menlo, Consolas, monospace;

  --accent:      #7c6cff;
  --accent-2:    #35d7e6;
  --accent-3:    #ffab55;

  --radius-lg: 28px;
  --radius:    20px;
  --radius-sm: 12px;

  --maxw: 1120px;
  /* comfortable reading measure — 68ch at the page's maximum font size.
     Kept in px so the card widths below can be derived from it exactly. */
  --measure: 594px;
  --card-pad: clamp(20px, 2.4vw, 28px);
  --tl-indent: clamp(26px, 3.4vw, 44px);
  /* gutter grows to clear a notch / rounded corners in landscape */
  --pad:  calc(clamp(18px, 4vw, 40px) +
               max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* dark (default) */
:root, [data-theme="dark"] {
  --bg:          #07080b;
  --bg-2:        #0b0d13;
  --text:        #eef0f6;
  --text-soft:   #b3b8c9;
  --text-mute:   #7d8398;

  --glass-bg:      rgba(255, 255, 255, .045);
  --glass-bg-hi:   rgba(255, 255, 255, .07);
  --glass-brd:     rgba(255, 255, 255, .10);
  --glass-brd-hi:  rgba(255, 255, 255, .20);
  --glass-shadow:  0 24px 60px -20px rgba(0, 0, 0, .75);
  --sheen:         rgba(255, 255, 255, .55);
  --hl:            rgba(255, 255, 255, .09);

  /* hairlines and small filled surfaces — must read on both themes */
  --line:          rgba(255, 255, 255, .11);
  --line-hi:       rgba(255, 255, 255, .24);
  --fill:          rgba(255, 255, 255, .06);

  --orb-1: #6b4bff;
  --orb-2: #16a5b8;
  --orb-3: #ff8a3d;
  --orb-alpha: .3;
  --grain-alpha: .05;
}

/* light */
[data-theme="light"] {
  --bg:          #f2f3f7;
  --bg-2:        #e9ebf2;
  --text:        #131620;
  --text-soft:   #454b5e;
  --text-mute:   #6d7488;

  --glass-bg:      rgba(255, 255, 255, .55);
  --glass-bg-hi:   rgba(255, 255, 255, .72);
  --glass-brd:     rgba(255, 255, 255, .85);
  --glass-brd-hi:  rgba(255, 255, 255, 1);
  --glass-shadow:  0 24px 50px -22px rgba(28, 32, 54, .32);
  --sheen:         rgba(255, 255, 255, .95);
  --hl:            rgba(255, 255, 255, .7);

  --line:          rgba(20, 24, 42, .11);
  --line-hi:       rgba(20, 24, 42, .2);
  --fill:          rgba(20, 24, 42, .045);

  --orb-1: #8f7bff;
  --orb-2: #4fd3e0;
  --orb-3: #ffb56b;
  --orb-alpha: .34;
  --grain-alpha: .035;
}

/* give the content a little more room on very large displays */
@media (min-width: 1500px) {
  :root { --maxw: 1240px; }
}

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

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

body {
  min-height: 100svh;
  font-family: var(--font-sans);
  font-size: clamp(15px, .35vw + 14px, 16.5px);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
  transition: background .5s var(--ease), color .5s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.022em; font-weight: 620; text-wrap: balance; }
p { text-wrap: pretty; }
code {
  font-family: var(--font-mono);
  font-size: .86em;
  padding: .1em .42em;
  border-radius: 6px;
  background: var(--fill);
  border: 1px solid var(--line);
  color: var(--text);
}

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

/* ============================================================
   ambient background
   ============================================================ */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-2) 0%, var(--bg) 62%);
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: var(--orb-alpha);
  will-change: transform;
}
.orb--1 {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
  top: -12vw; left: -8vw;
  background: var(--orb-1);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.orb--2 {
  width: 40vw; height: 40vw; min-width: 300px; min-height: 300px;
  top: 26vh; right: -12vw;
  background: var(--orb-2);
  opacity: calc(var(--orb-alpha) * .8);
  animation: drift-b 32s var(--ease) infinite alternate;
}
.orb--3 {
  width: 34vw; height: 34vw; min-width: 260px; min-height: 260px;
  bottom: -10vw; left: 26vw;
  background: var(--orb-3);
  opacity: calc(var(--orb-alpha) * .55);
  animation: drift-c 38s var(--ease) infinite alternate;
}

@keyframes drift-a { to { transform: translate3d(9vw, 7vh, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-8vw, -9vh, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(7vw, -6vh, 0) scale(1.15); } }

/* fine film grain so the blur never looks flat */
.grain {
  position: absolute;
  inset: -200%;
  opacity: var(--grain-alpha);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   glass primitive
   ============================================================ */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--hl);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  isolation: isolate;
}
.glass--hi { background: var(--glass-bg-hi); }

/* top-edge specular sheen */
.glass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg,
    transparent 8%, var(--sheen) 50%, transparent 92%);
  opacity: .35;
  pointer-events: none;
}

/* cursor-tracked highlight (coords set from JS) */
.glass--track::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%),
              var(--hl), transparent 65%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.glass--track:hover::after { opacity: 1; }

/* ============================================================
   layout
   ============================================================ */
main { width: 100%; }

.hero, .section {
  width: min(100% - var(--pad) * 2, var(--maxw));
  margin-inline: auto;
}

/* the min keeps the hero clear of the fixed theme toggle on short/narrow screens */
.hero { padding-top: clamp(76px, 9vh, 110px); }
.section { padding-top: clamp(64px, 11vh, 130px); }
.section--tight { padding-top: clamp(48px, 8vh, 96px); }

/* ============================================================
   hero
   ============================================================ */
.hero__card {
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 52px);
  display: grid;
  gap: clamp(26px, 3.4vw, 40px);
}

.hero__id {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 34px);
  flex-wrap: wrap;
}

/* wide screens: identity on the left, bio on the right, stats across the bottom */
@media (min-width: 1000px) {
  .hero__card {
    grid-template-columns: minmax(260px, 352px) 1fr;
    column-gap: clamp(36px, 4.4vw, 56px);
    align-items: start;
  }
  .hero__id {
    grid-column: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
  .hero__bio { grid-column: 2; grid-row: 1; }
  .stats { grid-column: 1 / -1; }
}

.avatar {
  position: relative;
  flex: none;
  width: clamp(124px, 17vw, 196px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2) 45%, var(--accent-3));
  box-shadow: 0 0 0 1px var(--glass-brd), 0 18px 40px -14px rgba(0, 0, 0, .6);
}
.avatar::after {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: .22;
  filter: blur(18px);
  z-index: -1;
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-2);
}

.hero__names { min-width: min(100%, 260px); }
.hero__names h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.3rem);
  font-weight: 700;
  letter-spacing: -.035em;
  background: linear-gradient(100deg, var(--text) 20%, var(--accent-2) 62%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__role {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: clamp(.98rem, 1.4vw, 1.1rem);
}

/* socials */
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: .89rem;
  font-weight: 520;
  color: var(--text-soft);
  transition: transform .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), background .3s var(--ease);
}
.social svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.social:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: var(--glass-brd-hi);
  background: var(--glass-bg-hi);
}
.socials--lg .social { padding: 11px 18px; font-size: .95rem; }

/* bio */
.hero__bio {
  display: grid;
  gap: 14px;
  max-width: 68ch;
  color: var(--text-soft);
  font-size: clamp(.98rem, 1.15vw, 1.06rem);
}
.hero__bio .lead {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.02em;
}
.muted { color: var(--text-mute); font-size: .95em; }

/* stats */
.stats {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  background: var(--glass-bg);
}
.stat b {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 660;
  letter-spacing: -.03em;
}
.stat span {
  font-size: .78rem;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .09em;
}

/* ============================================================
   section headings
   ============================================================ */
.section__head { margin-bottom: clamp(22px, 3vw, 36px); max-width: 62ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

.section h2 {
  margin-top: 10px;
  font-size: clamp(1.65rem, 3.6vw, 2.4rem);
}
.section__sub {
  margin-top: 10px;
  color: var(--text-mute);
  font-size: clamp(.95rem, 1.2vw, 1.05rem);
}

/* ============================================================
   cards
   ============================================================ */
.grid { display: grid; gap: clamp(14px, 1.6vw, 20px); }

/* one column on phones, two on tablets (last card spans so no orphan gap),
   three once there's room for a comfortable measure */
.grid--3 { grid-template-columns: 1fr; }

@media (min-width: 680px) and (max-width: 1023.98px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 > :last-child { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.32rem);
  letter-spacing: -.028em;
}
.card p { color: var(--text-soft); font-size: .955rem; max-width: var(--measure); }

.card__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--fill);
  border: 1px solid var(--line);
}
.card__tag {
  margin-top: -6px;
  font-family: var(--font-mono);
  font-size: .8rem !important;
  letter-spacing: .01em;
  color: var(--text-mute) !important;
}

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  font-size: .755rem;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-mute);
  border: 1px solid var(--line);
  background: var(--fill);
}

.card--link {
  transition: transform .45s var(--ease), border-color .45s var(--ease),
              box-shadow .45s var(--ease);
}
.card--link:hover {
  transform: translateY(-5px);
  border-color: var(--glass-brd-hi);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--hl),
              0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent);
}

.card__go {
  margin-top: auto;      /* pin to the bottom so cards in a row line up */
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent-2);
}
.card__go svg {
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .35s var(--ease);
}
.card--link:hover .card__go svg { transform: translate(2px, -2px); }

/* ============================================================
   timeline
   ============================================================ */
.timeline {
  list-style: none;
  /* sized so the paragraphs inside fill the cards edge to edge */
  max-width: calc(var(--measure) + 2 * var(--card-pad) + var(--tl-indent));
  padding: 0;
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  position: relative;
}

.tl {
  position: relative;
  padding-left: var(--tl-indent);
}
/* the rail */
.tl::before {
  content: "";
  position: absolute;
  left: clamp(6px, .9vw, 11px);
  top: 26px;
  bottom: calc(-1 * clamp(14px, 1.8vw, 22px) - 8px);
  width: 1px;
  background: linear-gradient(var(--line-hi), var(--line) 65%, transparent);
}
.tl:last-child::before { display: none; }

.tl__dot {
  position: absolute;
  left: clamp(1px, .4vw, 6px);
  top: 22px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-hi);
}
.tl--accent .tl__dot {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 14px 1px color-mix(in srgb, var(--accent) 60%, transparent);
}

.tl__years, .years {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--text-mute);
}
.tl .card h3, .career h3 { margin-top: -4px; }
.tl .card b, .career b { color: var(--text); font-weight: 620; }

/* the career card matches a timeline card, minus the rail indent */
.career { max-width: calc(var(--measure) + 2 * var(--card-pad)); }

/* ============================================================
   contact
   ============================================================ */
.contact {
  border-radius: var(--radius-lg);
  padding: clamp(26px, 3.4vw, 44px);
  display: flex;
  flex-direction: row;   /* overrides the column direction inherited from .card */
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.contact h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.contact .section__sub { max-width: 44ch; }
.contact .socials { margin-top: 0; }

/* ============================================================
   theme toggle
   ============================================================ */
.theme-toggle {
  position: fixed;
  top: calc(clamp(14px, 2.4vw, 26px) + env(safe-area-inset-top, 0px));
  right: calc(clamp(14px, 2.4vw, 26px) + env(safe-area-inset-right, 0px));
  z-index: 20;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-soft);
  transition: transform .35s var(--ease), color .35s var(--ease),
              border-color .35s var(--ease);
}
.theme-toggle:hover { transform: scale(1.07); color: var(--text); border-color: var(--glass-brd-hi); }
.theme-toggle .icon {
  grid-area: 1 / 1;
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  transition: opacity .3s var(--ease), transform .45s var(--ease);
}
[data-theme="dark"]  .icon--moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
[data-theme="dark"]  .icon--sun  { opacity: 1; }
[data-theme="light"] .icon--sun  { opacity: 0; transform: rotate(60deg) scale(.6); }
[data-theme="light"] .icon--moon { opacity: 1; }

/* ============================================================
   footer
   ============================================================ */
.footer {
  width: min(100% - var(--pad) * 2, var(--maxw));
  margin: clamp(60px, 10vh, 120px) auto 0;
  padding: 26px 0 calc(clamp(30px, 5vh, 54px) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: .84rem;
  color: var(--text-mute);
}
.totop { display: inline-block; transition: color .3s var(--ease); }
.totop:hover { color: var(--text); }

/* comfortable touch targets on touch devices */
@media (pointer: coarse) {
  .social { padding: 12px 16px; }
  .totop  { padding-block: 8px; }
}

/* ============================================================
   reveal on scroll
   ============================================================ */
/* only hide when JS is present to reveal them again */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ============================================================
   responsive tweaks
   ============================================================ */
@media (max-width: 560px) {
  .hero__id { gap: 18px; }
  .hero__names h1 { font-size: 2rem; }
  .social span { font-size: .84rem; }
  .contact { flex-direction: column; align-items: flex-start; }
}

/* backdrop-filter fallback: lean on solid-ish surfaces */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  [data-theme="dark"]  { --glass-bg: rgba(20, 22, 30, .86); --glass-bg-hi: rgba(26, 29, 40, .9); }
  [data-theme="light"] { --glass-bg: rgba(255, 255, 255, .9); --glass-bg-hi: rgba(255, 255, 255, .96); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .aurora, .theme-toggle, .totop { display: none; }
  body { background: #fff; color: #000; }
  .glass { box-shadow: none; border-color: #ccc; background: none; }
}
