@import url(/fonts.css);

/* Same palette and type as the 3D portfolio, in a plain scrolling page. */
:root {
  --bg: #030208;
  --ink: #ece8ff;
  --dim: rgba(226, 220, 255, 0.62);
  --faint: rgba(226, 220, 255, 0.36);
  --line: rgba(180, 164, 255, 0.16);
  --line-strong: rgba(180, 164, 255, 0.34);
  --lav: #b4a4ff;
  --sys: #5fd0ff;
  --gen: #ff9248;
  --hot: #ffcf8a;
  --acc: var(--lav);
  --card: rgba(12, 9, 30, 0.62);
  --display: 'Unbounded', 'Bahnschrift', system-ui, sans-serif;
  --body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Consolas', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(18px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60vw 50vh at 12% -10%, rgba(95, 208, 255, 0.07), transparent 70%),
    radial-gradient(60vw 60vh at 100% 30%, rgba(255, 146, 72, 0.06), transparent 70%),
    radial-gradient(80vw 60vh at 50% 110%, rgba(120, 90, 255, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
::selection { background: rgba(180, 164, 255, 0.35); }
:focus-visible { outline: 1px solid var(--lav); outline-offset: 3px; }

#waves { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }

/* ---------------------------------------------------------------- top bar */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--pad); background: linear-gradient(rgba(3, 2, 8, 0.92), rgba(3, 2, 8, 0.7)); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: 28px; height: 28px; color: var(--lav); filter: drop-shadow(0 0 8px rgba(180, 164, 255, 0.5)); transition: transform 0.8s var(--ease-out); }
.brand:hover svg { transform: rotate(60deg); }
.brand-name { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: 0.22em; line-height: 1.1; display: flex; flex-direction: column; }
.brand-name small { font-size: 8.5px; letter-spacing: 0.18em; color: var(--faint); margin-top: 5px; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.pill {
  height: 36px; border: 1px solid var(--line); border-radius: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  background: rgba(8, 6, 20, 0.35); transition: border-color 0.3s, background 0.3s; white-space: nowrap;
}
.pill:hover { border-color: var(--line-strong); background: rgba(180, 164, 255, 0.07); }
.pill-hot { color: var(--hot); border-color: rgba(255, 207, 138, 0.35); }
.pill-hot:hover { border-color: rgba(255, 207, 138, 0.7); background: rgba(255, 207, 138, 0.08); }
.lang { position: relative; display: inline-flex; height: 36px; padding: 3px; border: 1px solid var(--line); border-radius: 40px; background: rgba(8, 6, 20, 0.35); }
.lang button { position: relative; z-index: 1; width: 40px; border-radius: 30px; color: var(--faint); font-size: 10.5px; letter-spacing: 0.16em; transition: color 0.35s; }
.lang button:hover, .lang button.is-active { color: var(--ink); }
.lang-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 40px; border-radius: 30px;
  background: radial-gradient(circle, rgba(180, 164, 255, 0.28), rgba(180, 164, 255, 0.08));
  box-shadow: 0 0 14px rgba(180, 164, 255, 0.35), inset 0 0 0 1px rgba(180, 164, 255, 0.45); transition: transform 0.55s var(--ease-out);
}
.lang[data-active="en"] .lang-thumb { transform: translateX(40px); }

/* ---------------------------------------------------------------- layout */
main { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 0 var(--pad) 40px; }
.notice {
  margin: 24px 0 0; padding: 14px 18px; border: 1px solid rgba(255, 207, 138, 0.35); border-radius: 4px; color: var(--hot);
  background: rgba(255, 207, 138, 0.06); line-height: 1.7; letter-spacing: 0.08em;
}
.label { color: var(--faint); margin: 0 0 12px; }

.hero { padding: clamp(48px, 9vh, 96px) 0 40px; }
.eyebrow { color: var(--faint); margin: 0 0 18px; }
.eyebrow span { color: var(--hot); }
.name {
  font-family: var(--display); font-weight: 700; font-size: clamp(56px, 11vw, 132px); line-height: 0.9; letter-spacing: -0.03em; margin: 0;
  background: linear-gradient(100deg, #fff 10%, var(--lav) 55%, var(--hot) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role { font-family: var(--display); font-weight: 400; font-size: clamp(15px, 1.7vw, 20px); letter-spacing: -0.01em; margin: 22px 0 0; color: var(--ink); }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 22px 0 0; }
.facts li { padding: 7px 12px; border: 1px solid var(--line); border-radius: 30px; color: var(--dim); }
.facts .is-open { color: #9ff0c4; border-color: rgba(159, 240, 196, 0.35); display: inline-flex; align-items: center; gap: 8px; }
.facts .is-open i { width: 6px; height: 6px; border-radius: 50%; background: #6ff0a8; box-shadow: 0 0 8px #6ff0a8; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.contacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.contact {
  --c: var(--lav); display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 10px; border: 1px solid var(--line); border-radius: 40px;
  background: var(--card); transition: border-color 0.3s, box-shadow 0.3s;
}
.contact:hover { border-color: var(--c); box-shadow: 0 0 24px -6px var(--c); }
.c-tg { --c: #6cc4ff; } .c-mail { --c: var(--hot); }
.c-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--c); font-family: var(--display); }
.c-icon svg { width: 15px; height: 15px; fill: currentColor; }
.contact > span:last-child { display: flex; flex-direction: column; line-height: 1.15; gap: 3px; }
.contact small { font-size: 9px; color: var(--faint); }
.contact b { font-family: var(--display); font-weight: 400; font-size: 13px; }

.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); padding: 36px 0 8px; border-top: 1px solid var(--line); }
.summary { margin: 0; font-size: 17px; line-height: 1.65; color: var(--ink); }
.skill { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.skill:last-child { border-bottom: 0; }
.skill > .mono { color: var(--lav); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.chips li { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 3px; color: var(--dim); background: rgba(180, 164, 255, 0.04); }

/* ---------------------------------------------------------------- sections */
.sec { padding-top: 64px; }
.sec-head { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 24px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); position: relative; }
.sec-head::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 120px; height: 1px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.sec-head .mono { grid-column: 1 / -1; color: var(--faint); margin-bottom: 10px; }
.sec-head .mono b { color: var(--acc); font-weight: 400; }
.sec-head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; margin: 0; line-height: 1; }
.sec-head p { margin: 0; color: var(--dim); justify-self: end; text-align: right; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trio { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pair { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card {
  position: relative; display: grid; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  backdrop-filter: blur(6px); transition: border-color 0.35s;
}
.card:hover { border-color: color-mix(in srgb, var(--acc) 45%, transparent); }
.card::before { content: ''; position: absolute; left: 22px; top: -1px; width: 36px; height: 1px; background: var(--acc); }
.card-wide { grid-column: 1 / -1; grid-template-columns: 1fr 1.15fr; gap: 32px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head h3 { font-family: var(--display); font-weight: 500; font-size: 21px; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
.card-feature .card-head h3 { font-size: 26px; }
.tag { flex: none; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); color: var(--acc); border-radius: 30px; font-size: 9.5px; white-space: nowrap; }
.tag-link:hover { background: color-mix(in srgb, var(--acc) 12%, transparent); }
.kicker { color: var(--faint); margin: 8px 0 0; line-height: 1.6; letter-spacing: 0.1em; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.metric { padding-top: 10px; border-top: 1px solid var(--line); }
.metric b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(18px, 2vw, 24px); letter-spacing: -0.02em; color: var(--acc); line-height: 1.1; white-space: nowrap; }
.metric span { display: block; font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.35; }
.card-feature .metric b { font-size: clamp(20px, 2.2vw, 27px); }
.card-feature .metrics { gap: 18px; }
.points { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.points li { position: relative; padding-left: 18px; color: var(--dim); font-size: 14px; line-height: 1.55; }
.points li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 1px; background: var(--acc); }
.card:not(.card-wide) { grid-template-rows: auto 1fr; }

.card-repos { grid-template-columns: 1fr; gap: 0; }
.repos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.repo { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; transition: border-color 0.3s, background 0.3s; }
.repo:hover { border-color: color-mix(in srgb, var(--acc) 50%, transparent); background: rgba(95, 208, 255, 0.04); }
.repo-name { color: var(--ink); letter-spacing: 0.04em; text-transform: none; font-size: 12.5px; }
.repo-name i { font-style: normal; color: var(--acc); }
.repo-text { color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.repo-stack { color: var(--faint); letter-spacing: 0.08em; text-transform: none; font-size: 10.5px; }

/* ---------------------------------------------------------------- generation cards */
.card-gen { padding: 0; gap: 0; overflow: hidden; grid-template-rows: auto 1fr; }
.card-gen::before { z-index: 2; }
.card-gen .card-body { padding: 18px 20px 20px; }
.text { margin: 12px 0 0; color: var(--dim); font-size: 14px; line-height: 1.55; }
.media { position: relative; height: 320px; display: flex; justify-content: center; align-items: stretch; gap: 6px; padding: 0; overflow: hidden; background: #000; }
.media-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(22px) brightness(0.45) saturate(1.2); }
.clip { position: relative; margin: 0; height: 100%; aspect-ratio: 16 / 9; max-width: 100%; }
.media.is-portrait .clip { aspect-ratio: 9 / 16; }
.media:not(.is-portrait) { align-items: center; }
/* Two portrait clips share the frame: each takes half and crops to fill. */
.media[data-count="2"] .clip { aspect-ratio: auto; flex: 1 1 0; min-width: 0; }
.media:not(.is-portrait) .clip { height: auto; width: 100%; }
.clip-play, .clip video { position: relative; display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.clip-play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.8s var(--ease-out), filter 0.4s; }
.clip-play:hover img { transform: scale(1.04); filter: brightness(1.1); }
.clip-btn {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(3, 2, 8, 0.55); border: 1px solid rgba(255, 255, 255, 0.4); backdrop-filter: blur(6px); transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
.clip-btn svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }
.clip-play:hover .clip-btn { transform: scale(1.1); border-color: var(--acc); }
.clip figcaption { position: absolute; left: 8px; bottom: 8px; padding: 3px 7px; border-radius: 3px; background: rgba(3, 2, 8, 0.6); color: var(--ink); font-size: 9px; pointer-events: none; }
.print-only, .print-note { display: none; }

/* ---------------------------------------------------------------- footer */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; font-family: var(--display); font-size: 13px; }
.foot-links a:hover { color: var(--hot); }
.foot-right { text-align: right; }
.foot-right .foot-links { justify-content: flex-end; }
.foot-date { color: var(--faint); margin: 14px 0 0; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 900px) {
  .about, .card-wide { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr 1fr; }
  .trio .card-gen:first-child { grid-column: 1 / -1; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-head p { justify-self: start; text-align: left; margin-top: 10px; }
}
@media (max-width: 640px) {
  .grid, .trio, .repos, .pair { grid-template-columns: 1fr; }
  .bar { padding: 12px 14px; }
  .brand-name small { display: none; }
  .bar-right { gap: 6px; }
  .pill { padding: 0 11px; }
  .contact { width: 100%; }
  .metrics { gap: 8px; }
  .foot-right { text-align: left; }
  .foot-right .foot-links { justify-content: flex-start; }
}
@media (max-width: 400px) { #to-3d { display: none; } }

/* ---------------------------------------------------------------- print / PDF: light, compact, no media */
@media print {
  @page { size: A4; margin: 9mm 11mm; }
  :root { --ink: #14121c; --dim: #3d3a4a; --faint: #77738a; --line: #dcd8e8; --line-strong: #c4bfd8; --card: #fff; --sys: #0a7fae; --gen: #c4561a; --hot: #b06a1c; }
  html, body { background: #fff !important; color: var(--ink); font-size: 10.5pt; }
  #waves, .bar, .notice, .media, .clip-btn { display: none !important; }
  .print-only { display: block; color: var(--faint); margin: 8px 0 0; }
  main { max-width: none; padding: 0; }
  .hero { padding: 0 0 14px; }
  .name { font-size: 40pt; background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); }
  .role { margin-top: 8px; font-size: 12.5pt; }
  .facts { margin-top: 10px; }
  .facts li { padding: 3px 9px; }
  .facts .is-open { color: #1e8a50; border-color: #9fd9b8; }
  .facts .is-open i { background: #1e8a50; box-shadow: none; animation: none; }
  .contacts { margin-top: 12px; gap: 8px; }
  .contact { padding: 4px 12px 4px 4px; background: none; }
  .c-icon { width: 24px; height: 24px; font-size: 11px; }
  .c-icon svg { width: 11px; height: 11px; }
  .about { padding: 14px 0 0; gap: 22px; grid-template-columns: 1.05fr 1fr; }
  .summary { font-size: 10.5pt; }
  .skill { padding: 4px 0; grid-template-columns: 64px 1fr; }
  .chips li { font-size: 8pt; padding: 1px 6px; background: none; }
  .sec { padding-top: 16px; }
  .sec-head { padding-bottom: 8px; margin-bottom: 10px; }
  .sec-head::after { box-shadow: none; }
  .sec-head h2 { font-size: 18pt; }
  .sec-head .mono { margin-bottom: 4px; }
  .grid { gap: 8px; }
  .card { padding: 12px 14px; gap: 12px; backdrop-filter: none; break-inside: avoid; }
  .card-wide { gap: 20px; }
  .card-gen { padding: 0; }
  .card-gen .card-body { padding: 12px 14px; }
  .card-head h3, .card-feature .card-head h3 { font-size: 13pt; }
  .kicker { margin-top: 4px; }
  .metrics { margin-top: 10px; gap: 8px; }
  .metric { padding-top: 6px; }
  .metric b, .card-feature .metric b { font-size: 14pt; }
  .metric span { font-size: 8.5pt; margin-top: 3px; }
  .points { gap: 4px; margin-bottom: 10px; }
  .points li, .text, .repo-text { font-size: 9.5pt; line-height: 1.45; }
  .text { margin-top: 6px; }
  .repos { margin-top: 10px; gap: 6px; }
  .repo { padding: 8px 10px; break-inside: avoid; }
  .foot { margin-top: 18px; padding-top: 10px; }
  .foot-links { font-size: 9.5pt; }
  .foot-date { margin-top: 6px; }
  a { color: inherit; }
}
@media print {
  /* A4 is narrower than the 900px breakpoint: restore the wide layout so the CV fits on two pages. */
  .card-wide { grid-template-columns: 1fr 1.15fr; }
  .card-repos { grid-template-columns: 1fr; align-content: start; }
  .trio { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .trio .card-gen:first-child { grid-column: auto; }
  .sec-head { grid-template-columns: auto 1fr; break-after: avoid; }
  .sec-head p { justify-self: end; text-align: right; margin-top: 0; }
  .card-gen .print-only, .print-note { display: none; }
  .sec-head .print-note { display: inline; }
  .sec-sys { --acc: #0a7fae !important; }
  .sec-gen { --acc: #c4561a !important; }
}
@media print {
  html, body { font-size: 9.5pt; }
  .summary { font-size: 10pt; }
  .skill .chips { gap: 0; }
  .skill .chips li { border: 0; padding: 0; background: none; font-size: 9pt; color: var(--dim); }
  .skill .chips li:not(:last-child)::after { content: '\00a0·\00a0'; color: var(--faint); }
  .foot, .card-gen .kicker { display: none; }
  .card { gap: 10px; }
  .card-repos { gap: 0; }
  .points li, .text, .repo-text { font-size: 9pt; }
}
@media print {
  /* Grid rows fragment badly across pages: lay the systems out as blocks and start the pair on page two. */
  .sec .grid { display: block; }
  .sec .grid > * + * { margin-top: 8px; }
  .repo-stack { display: none; }
  .sec { padding-top: 10px; }
  .pair { break-before: page; gap: 8px; }
}
