:root {
  --bg: #090909;
  --text: #ececec;
  --text-fade: rgba(236, 236, 236, 0.3);
  --muted: #8a8a8a;
  --accent: #e5251b;
  --logo-2: #fff;
  --halo: #000;          
  --location-sub: #b5b5b5;
  --star: 255, 255, 255; 
  --btn-bg: rgba(0, 0, 0, 0.55);
  --btn-border: rgba(255, 255, 255, 0.18);
}


:root[data-theme="light"] {
  --bg: #f6f6f5;
  --text: #111111;
  --text-fade: rgba(17, 17, 17, 0.3);
  --muted: #6f6f6f;
  --logo-2: #111;
  --halo: #fff;
  --location-sub: #555;
  --star: 0, 0, 0;
  --btn-bg: rgba(255, 255, 255, 0.7);
  --btn-border: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: "Inter Tight", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}

#hero-bg {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 460px;
  display: block;
  pointer-events: none;
  z-index: 0;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 40px;
}

.logo { position: relative; display: block; width: 34px; height: 34px; }
.logo span { position: absolute; display: block; }
.logo span:first-child { width: 18px; height: 18px; right: 0; bottom: 0; background: var(--logo-2); transition: background .5s; }
.logo span:last-child { width: 26px; height: 26px; left: 0; top: 0; background: var(--accent); }

.location { text-align: right; font-size: 14px; line-height: 1.25; letter-spacing: -0.02em; text-shadow: 0 0 12px var(--halo), 0 0 4px var(--halo); }
.location strong { display: block; font-weight: 600; }
.location span { color: var(--location-sub); font-size: 12px; font-variant-numeric: tabular-nums; }

.topbar-right { display: flex; align-items: flex-start; gap: 14px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--btn-border);
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  transition: background .3s, color .5s, transform .3s;
}
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }


.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 120px 16px 80px;
}

.portrait {
  position: absolute;
  left: 50%;
  top: 14vh;
  transform: translateX(-50%);
  width: min(520px, 78vw);
  height: auto;
  
  filter: grayscale(1) brightness(.42) contrast(1.25);
  -webkit-mask-image: radial-gradient(ellipse 50% 55% at 50% 42%, #000 35%, transparent 78%);
          mask-image: radial-gradient(ellipse 50% 55% at 50% 42%, #000 35%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

:root[data-theme="light"] .portrait {
  filter: grayscale(1) contrast(1.1);
  mix-blend-mode: multiply;
  opacity: .32 !important;   
}

.hero-inner { position: relative; z-index: 1; margin-top: 12vh; }

.headline {
  margin: 0;
  font-weight: 700;
  font-size: clamp(44px, 14vw, 150px);
  line-height: 0.84;
  letter-spacing: -0.055em;
  color: var(--text);
}
.headline .line { display: block; white-space: nowrap; }
.headline { padding-bottom: 0.12em; }


.headline .fade { color: transparent; }

.dot {
  display: inline-block;
  width: 0.14em;
  height: 0.14em;
  margin-left: 0.04em;
  background: var(--accent);
}

.sub {
  margin: 2em 0 0;
  font-size: clamp(16px, 1.2vw, 22px);
  line-height: 1.6;
  letter-spacing: -0.03em;
  font-weight: 500;
}
.sub .muted { color: var(--muted); font-weight: 400; }

.link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 1px;
  transition: color .2s, border-color .2s;
}
.link:hover { color: var(--accent); border-color: var(--accent); }


.cursor {
  position: absolute;
  left: 62%;
  top: 17vh;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  pointer-events: none;
  animation: wander 14s ease-in-out infinite;
}
.cursor svg { fill: var(--accent); margin-top: 14px; }
.cursor span {
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 12px;
  margin-left: 2px;
}

@keyframes wander {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(-40px, 30px); }
  50%      { transform: translate(20px, 60px); }
  75%      { transform: translate(50px, 10px); }
}

@media (max-width: 640px) {
  .topbar { padding: 16px; }
  .cursor { left: 55%; }
}



.headline .w {
  display: inline-block;
  animation: word-in 1.1s cubic-bezier(.2, .7, .2, 1) both;
}
.headline .w:nth-child(1) { animation-delay: .15s; }
.headline .w:nth-child(2) { animation-delay: .3s; }
.headline .w:nth-child(3) { animation-delay: .45s; }
.headline .line + .line .w:nth-child(1) { animation-delay: .6s; }
.headline .line + .line .w:nth-child(2) { animation-delay: .75s; }


.headline .fade .w {
  background: linear-gradient(180deg, var(--text) 40%, var(--text-fade) 85%);
  -webkit-background-clip: text;
          background-clip: text;
  
  padding: 0.05em 0.08em 0.22em;
  margin: -0.05em -0.08em -0.22em;
}

@keyframes word-in {
  from { opacity: .08; filter: blur(6px); transform: translateY(.06em); }
  to   { opacity: 1;   filter: blur(0);   transform: none; }
}

.portrait { animation: fade-in 1.6s ease both; }
.sub      { animation: fade-in .9s ease 1.1s both; }
.topbar   { animation: fade-in .9s ease .9s both; }
.cursor   { animation: cursor-in .5s ease 1.8s both, wander 14s ease-in-out 2.3s infinite; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cursor-in { from { opacity: 0; transform: translate(10px, -10px); } to { opacity: 1; transform: none; } }


.topbar { transition: background-color .3s, border-color .3s, padding .3s; border-bottom: 1px solid transparent; }
.topbar.scrolled {
  background: var(--bg);
  border-bottom-color: var(--line);
}


:root { --line: rgba(255, 255, 255, 0.12); --card-hover: rgba(255, 255, 255, 0.03); }
:root[data-theme="light"] { --line: rgba(0, 0, 0, 0.12); --card-hover: rgba(0, 0, 0, 0.025); }

.projects {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 60px 16px 60px;
}

.section-title {
  margin: 0 0 40px;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.045em;
}
.section-title .accent { color: var(--accent); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 220px;
  padding: 0 70px 0 26px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: background-color .3s, border-color .3s;
}
.project-card:hover { background: var(--card-hover); border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.project-card.wide { grid-column: 1 / -1; min-height: 0; padding: 32px 70px 32px 24px; }

.project-info h3 { margin: 0 0 14px; font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.project-info p  { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; max-width: 30ch; }
.project-card.wide .project-info p { max-width: none; }

.arrow {
  position: absolute;
  top: 36px;
  right: 34px;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.4;
  transition: transform .3s ease, stroke .3s;
}
.project-card:hover .arrow { transform: translate(3px, -3px); stroke: var(--accent); }


.phone {
  flex: none;
  align-self: flex-end;
  width: 172px;
  height: 194px;
  margin-top: 26px;
  padding: 7px 7px 0;
  border: 2px solid #3a3a3a;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: #0b0b0b;
  transition: transform .4s ease;
}
.project-card:hover .phone { transform: translateY(-6px); }
.phone img, .phone .screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 20px 20px 0 0;
}


.screen { position: relative; padding: 18px 14px; overflow: hidden; display: flex; flex-direction: column; gap: 9px; }
.screen i { display: block; height: 8px; border-radius: 4px; background: currentColor; opacity: .25; }
.screen i.short { width: 55%; }
.screen b { display: block; height: 60px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #ff8a5c); }
.screen .ui-icon { font-size: 44px; line-height: 1; margin: 8px 0 10px; filter: grayscale(1); }
.screen .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.screen .tiles span { height: 52px; border-radius: 8px; background: currentColor; opacity: .12; }

.screen-security { color: #fff; background: radial-gradient(circle at 50% 30%, rgba(229, 37, 27, .55), transparent 60%), #111; }
.screen-auto     { color: #fff; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .18), transparent 55%), #151515; }
.screen-web      { color: #111; background: #f4f4f4; }
.screen-app      { color: #111; background: #fff; }
.screen-app .tiles span:nth-child(2) { background: var(--accent); opacity: .7; }

@media (max-width: 860px) {
  .project-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .project-card { gap: 16px; padding: 0 56px 0 16px; }
  .phone { width: 128px; height: 160px; }
  .arrow { top: 22px; right: 20px; }
}


.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.visible { opacity: 1; transform: none; }


.to-top {
  position: fixed;
  right: 40px;
  bottom: 32px;
  z-index: 20;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, background-color .5s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top > svg { grid-area: 1 / 1; }
.to-top .ring { width: 56px; height: 56px; transform: rotate(-90deg); }
.to-top .ring circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 163.4;           
  stroke-dashoffset: calc(163.4 * (1 - var(--progress, 0)));
}
.to-top::before {                    
  content: "";
  grid-area: 1 / 1;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.to-top .chev { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover .chev { stroke: var(--accent); }
@media (max-width: 640px) { .to-top { right: 16px; bottom: 16px; } }


.education {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 80px 16px 40px;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(40px, 12vw, 150px);
}

.edu-list { list-style: none; margin: 0; padding: 0; }
.edu-list li { padding: 20px 0 24px; border-bottom: 1px solid var(--line); }
.edu-list li:first-child { padding-top: 0; }
.edu-list li:last-child { border-bottom: 0; }

.edu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.edu-head h3 { margin: 0; font-size: 18px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.35; }
.edu-date { flex: none; color: var(--muted); font-size: 17px; font-variant-numeric: tabular-nums; }
.edu-list p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }

.edu-badge {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

@media (max-width: 860px) {
  .edu-grid { grid-template-columns: 1fr; }
  
  .edu-list:first-child li:last-child { border-bottom: 1px solid var(--line); }
  .edu-list:last-child li:first-child { padding-top: 20px; }
}


:root { --panel: rgba(255, 255, 255, 0.025); --panel-2: rgba(255, 255, 255, 0.05); --dot: rgba(255, 255, 255, 0.09); }
:root[data-theme="light"] { --panel: rgba(0, 0, 0, 0.02); --panel-2: rgba(0, 0, 0, 0.04); --dot: rgba(0, 0, 0, 0.12); }

.fragments {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 80px 16px 20px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}
.frag {
  display: flex;
  flex-direction: column;
  padding: 20px 20px 26px;
  border: 1px solid var(--line);
  min-width: 0;
}
.frag h3 { margin: 22px 0 10px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.frag > p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.frag-langs { grid-column: 1 / 5;  grid-row: 1 / 3; }
.frag-draw  { grid-column: 5 / 10; }
.frag-term  { grid-column: 10 / 13; }
.frag-words { grid-column: 5 / 8; justify-content: center; align-items: center; min-height: 150px; }
.frag-os    { grid-column: 8 / 13; }
.frag-net   { grid-column: 1 / 5; }
.frag-db    { grid-column: 5 / 13; }

.frag-visual {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.frag-visual.dots {
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 16px 16px;
}


.timeline { flex: 1; min-height: 290px; }
.timeline::before {
  content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: var(--line);
}
.timeline::after {        
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--bg), transparent 18%, transparent 78%, var(--bg));
}
.timeline-track { position: absolute; left: 0; right: 0; top: 0; animation: tl-scroll 18s linear infinite; }
.frag-langs:hover .timeline-track { animation-play-state: paused; }
.tl-item {
  position: relative;
  margin: 18px 18px 0 42px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.tl-item::before {        
  content: ""; position: absolute; left: -26px; top: 50%; width: 11px; height: 11px; margin-top: -6px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--bg);
}
.tl-item strong { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.tl-item span { font-size: 13px; color: var(--muted); }
@keyframes tl-scroll { to { transform: translateY(-50%); } }


.draw-wrap { height: 140px; cursor: crosshair; touch-action: none; }
.draw-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.draw-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 12px; color: var(--muted); pointer-events: none; transition: opacity .3s;
}
.draw-wrap.used .draw-hint { opacity: 0; }
.chip-btn {
  position: absolute; right: 8px; bottom: 8px;
  padding: 5px 10px; font: 500 12px "Inter Tight", sans-serif;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }


.terminal { height: 140px; background: #0c0c0c; border-color: rgba(255,255,255,.12); }
.term-bar { display: flex; gap: 5px; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.term-bar i { width: 6px; height: 6px; border-radius: 50%; background: #e5251b; }
.term-bar i:nth-child(2) { background: #e5a21b; }
.term-bar i:nth-child(3) { background: #3bb54a; }
.term-body {
  margin: 0; padding: 8px 10px; color: #cfcfcf; white-space: pre; overflow: hidden;
  font: 10px/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.term-body .ok { color: #6bd17a; } .term-body .hi { color: #ff6b5e; } .term-body .dim { color: #8a8a8a; }
.caret { display: inline-block; width: 6px; height: 11px; background: #cfcfcf; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }


.words { margin: 0; display: flex; flex-direction: column; align-items: center; font-size: 18px; letter-spacing: -0.03em; line-height: 1.25; }
.words span { color: var(--muted); opacity: .45; transition: opacity .6s, color .6s; }
.words span.on { opacity: 1; color: var(--text); }


.os-window { height: 120px; display: flex; flex-direction: column; }
.os-tabs { display: flex; border-bottom: 1px solid var(--line); }
.os-tab {
  flex: 1; padding: 8px 0; border: 0; background: none; cursor: pointer;
  font: 500 12px "Inter Tight", sans-serif; color: var(--muted); border-bottom: 2px solid transparent;
}
.os-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.os-screen { flex: 1; margin: 0; padding: 10px 12px; font: 11px/1.6 ui-monospace, Consolas, monospace; color: var(--text); white-space: pre; overflow: hidden; }


.net-wrap { height: 160px; }
.net-wrap canvas { width: 100%; height: 100%; display: block; }


.db-wrap { height: 160px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; padding: 14px; align-items: start; }
.db-query { margin: 0; padding: 10px 12px; min-height: 100%; border: 1px solid var(--line); background: var(--bg); font: 11px/1.7 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.db-query .kw { color: var(--accent); }
.db-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--bg); border: 1px solid var(--line); }
.db-table th, .db-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.db-table th { color: var(--muted); font-weight: 500; }
.db-table tr.new { animation: row-in .4s ease both; }
.db-table .st { color: #3bb54a; }
@keyframes row-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.mini-cursor {
  position: absolute; right: 18%; bottom: 18%;
  display: flex; align-items: flex-start; pointer-events: none;
  animation: wander 11s ease-in-out infinite;
}
.mini-cursor svg { fill: var(--accent); margin-top: 12px; }
.mini-cursor span { background: var(--accent); color: #fff; font-size: 11px; font-weight: 500; padding: 2px 9px; margin-left: 2px; }

@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frag-langs { grid-column: 1 / 2; grid-row: auto; }
  .frag-draw, .frag-term, .frag-words, .frag-os, .frag-net { grid-column: auto; }
  .frag-db { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .frag-langs, .frag-db { grid-column: auto; }
  .db-wrap { grid-template-columns: 1fr; height: auto; }
}


.about {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 80px 16px 20px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.42fr;
  gap: 24px;
  align-items: start;
}
.about-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 208px;
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: background-color .3s, border-color .3s;
}
.about-card:hover { background: var(--card-hover); border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.about-card:hover .arrow { transform: translate(3px, -3px); stroke: var(--accent); }
.about-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.about-card h3 { margin: 0 0 14px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.about-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;          
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.about-card[aria-expanded="true"] p { -webkit-line-clamp: unset; }
.about-card[aria-expanded="true"] .arrow { transform: rotate(90deg); }

.about-meta { display: flex; gap: 22px; margin-top: auto; padding-top: 28px; font-size: 12px; color: var(--muted); }
.about-meta span { display: inline-flex; align-items: center; gap: 6px; }
.about-meta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.about-card .arrow { top: auto; bottom: 24px; right: 24px; }


.about-more { align-self: stretch; }
.more-blocks {
  position: relative;
  height: 90px;
  margin: 0 -24px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.more-blocks span {
  position: absolute;
  width: 88px; height: 34px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  transition: transform .5s ease;
}
.more-blocks span::before, .more-blocks span::after {
  content: ""; position: absolute; left: 8px; height: 3px; background: var(--line);
}
.more-blocks span::before { top: 9px; width: 30px; }
.more-blocks span::after  { top: 18px; width: 60px; }
.more-blocks span:nth-child(1) { left: -30px; top: 0; }
.more-blocks span:nth-child(2) { left: 62px;  top: 0; }
.more-blocks span:nth-child(3) { left: 160px; top: 0; }
.more-blocks span:nth-child(4) { left: 0;     top: 46px; }
.more-blocks span:nth-child(5) { left: 100px; top: 46px; }
.about-more:hover .more-blocks span:nth-child(odd)  { transform: translateX(10px); }
.about-more:hover .more-blocks span:nth-child(even) { transform: translateX(-10px); }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-more { min-height: 180px; }
}


.experience {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 80px 16px 140px;
}
.xp-timeline { position: relative; padding: 10px 0; }

.xp-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--line); }
.xp-line-fill { width: 100%; height: calc(var(--xp-progress, 0) * 100%); background: var(--accent); }

.xp-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: start;
  margin-bottom: 70px;
}
.xp-item:last-child { margin-bottom: 0; }

.xp-card {
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  max-width: 500px;
}
.xp-item.left  .xp-card  { grid-column: 1; grid-row: 1; justify-self: end; width: 100%; }
.xp-item.left  .xp-label { grid-column: 3; grid-row: 1; }
.xp-item.right .xp-card  { grid-column: 3; grid-row: 1; justify-self: start; width: 100%; }
.xp-item.right .xp-label { grid-column: 1; grid-row: 1; text-align: right; }
.xp-marker { grid-column: 2; grid-row: 1; display: flex; justify-content: center; padding-top: 22px; }

.xp-card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 500; }
.xp-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.xp-card li + li { margin-top: 10px; }
.xp-card li::marker { color: var(--muted); }
.xp-links { margin-top: 20px; font-size: 13px; display: flex; gap: 16px; }
.xp-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.xp-type { margin: 18px 0 0; min-height: 1.4em; font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--text); }

.xp-logo {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  font-weight: 700; font-size: 14px; color: #fff;
  box-shadow: 0 0 0 6px var(--bg);        
  transition: transform .3s;
}
.xp-item:hover .xp-logo { transform: scale(1.12); }
.logo-owleaf { background: #1f7a4d; }
.logo-inacap { background: #e5251b; }
.logo-free   { background: var(--text); color: var(--bg); }
.logo-free svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.xp-label { padding: 24px 18px 0; }
.xp-label strong { display: block; font-size: 15px; font-weight: 500; }
.xp-label span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }


.xp-item.left  .xp-card.reveal { transform: translateX(-30px); }
.xp-item.right .xp-card.reveal { transform: translateX(30px); }
.xp-item .xp-card.reveal.visible { transform: none; }

@media (max-width: 760px) {
  .xp-line { left: 15px; }
  .xp-item, .xp-item.left, .xp-item.right { grid-template-columns: 30px 1fr; column-gap: 16px; }
  .xp-marker { grid-column: 1; grid-row: 1; padding-top: 0; }
  .xp-item.left .xp-label, .xp-item.right .xp-label { grid-column: 2; grid-row: 1; text-align: left; padding: 4px 0 14px; }
  .xp-item.left .xp-card, .xp-item.right .xp-card { grid-column: 2; grid-row: 2; max-width: none; }
  .xp-item.left .xp-card.reveal, .xp-item.right .xp-card.reveal { transform: translateY(24px); }
}


.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 97%, var(--text));
  transition: background-color .5s;
}
.footer-inner {
  max-width: 1172px;
  margin: 0 auto;
  padding: 110px 16px 130px;
  display: flex;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none; font-size: 18px; font-weight: 500; letter-spacing: -0.01em;
}
.mini-logo { position: relative; width: 17px; height: 17px; }
.mini-logo span { position: absolute; }
.mini-logo span:first-child { width: 9px; height: 9px; right: 0; bottom: 0; background: var(--logo-2); }
.mini-logo span:last-child  { width: 13px; height: 13px; left: 0; top: 0; background: var(--accent); }
.footer-info > p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }

.socials { display: flex; gap: 16px; margin-top: 26px; }
.socials a { color: var(--text); transition: color .2s, transform .2s; }
.socials a:hover { color: var(--accent); transform: translateY(-2px); }
.socials svg { width: 17px; height: 17px; fill: currentColor; display: block; }

.footer-info .visits { margin-top: 36px; }
.visits strong { color: var(--text); font: 500 16px ui-monospace, Consolas, monospace; margin-left: 4px; }


.snake { text-align: center; margin-right: 40px; }
.snake-title { margin: 0 0 28px; color: var(--muted); font-size: 16px; }
.snake-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto; }
#snake {
  display: block; width: 150px; height: 150px;
  border: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  outline: none; cursor: pointer; touch-action: none;
}
#snake:focus-visible { border-color: var(--accent); }
.snake-over {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.snake-over[hidden] { display: none; }
.snake-over strong { font-size: 16px; font-weight: 500; }
.snake-over button {
  padding: 6px 12px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--text) 18%, var(--bg)); color: var(--text);
  font: 500 14px "Inter Tight", sans-serif;
}
.snake-over button:hover { background: var(--accent); color: #fff; }
.snake-score { display: flex; justify-content: space-between; width: 150px; margin: 10px auto 0; font-size: 12px; color: var(--muted); }
.snake-score b { color: var(--text); font: 500 12px ui-monospace, Consolas, monospace; margin-left: 4px; }

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; padding: 70px 16px 110px; }
  .snake { margin-right: 0; text-align: left; }
  .snake-wrap, .snake-score { margin-left: 0; }
}



.contact {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 40px 16px 140px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: start;
}
.contact-text p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 36ch; }

.contact-form { display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line); background: var(--bg); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 8px; }
.contact-form label span { font-size: 13px; color: var(--muted); }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 95%, var(--text));
  color: var(--text);
  font: 15px "Inter Tight", sans-serif;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form textarea::placeholder { color: var(--muted); opacity: .7; }
.send-btn {
  justify-self: start;
  padding: 11px 18px;
  border: 0;
  background: var(--text);
  color: var(--bg);
  font: 500 14px "Inter Tight", sans-serif;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.send-btn:hover { background: var(--accent); color: #fff; }

@media (max-width: 800px) {
  .contact { grid-template-columns: 1fr; gap: 24px; }
  .field-row { grid-template-columns: 1fr; }
}



.likes {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 80px 16px 20px;
}
.likes-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}
.like-card { display: flex; flex-direction: column; padding: 20px 20px 26px; border: 1px solid var(--line); transition: border-color .3s; }
.like-card:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.like-card h3 { margin: 22px 0 10px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.like-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.like-visual {
  display: grid; place-items: center;
  height: 170px;
  border: 1px solid var(--line);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 16px 16px;
}
.like-visual svg { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.like-visual.small svg { width: 120px; }


.circuit .board { fill: var(--bg); stroke: var(--text); stroke-width: 1.2; }
.circuit .pins path { stroke: var(--muted); stroke-width: 1.2; fill: none; }
.circuit .traces path, .like-visual .draw {
  fill: none; stroke: var(--text); stroke-width: 1.2; stroke-linecap: square; stroke-linejoin: miter;
  stroke-dasharray: 400; stroke-dashoffset: 400;
  transition: stroke-dashoffset 1.6s cubic-bezier(.4, 0, .2, 1);
}
.like-visual .draw { stroke-width: 1.6; stroke-dasharray: 200; stroke-dashoffset: 200; }
.circuit .traces path { stroke: var(--muted); }
.circuit .nodes circle { fill: var(--bg); stroke: var(--muted); stroke-width: 1.2; opacity: 0; transition: opacity .4s ease 1.2s; }
.circuit .led { fill: var(--accent); opacity: 0; transition: opacity .4s ease 1.4s; }


.like-card.visible .traces path, .like-card.visible .draw { stroke-dashoffset: 0; }
.like-card.visible .traces path:nth-child(2) { transition-delay: .1s; }
.like-card.visible .traces path:nth-child(3) { transition-delay: .2s; }
.like-card.visible .traces path:nth-child(4) { transition-delay: .3s; }
.like-card.visible .traces path:nth-child(5) { transition-delay: .4s; }
.like-card.visible .traces path:nth-child(6) { transition-delay: .5s; }
.like-card.visible .nodes circle { opacity: 1; }
.like-card.visible .led { opacity: 1; animation: led 1.6s ease-in-out 2s infinite; }
@keyframes led { 50% { opacity: .2; } }


.like-main:hover .traces path { stroke: var(--text); }

@media (max-width: 900px) {
  .likes-grid { grid-template-columns: 1fr 1fr; }
  .like-main { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .likes-grid { grid-template-columns: 1fr; }
}


.github {
  position: relative;
  z-index: 1;
  max-width: 1172px;
  margin: 0 auto;
  padding: 80px 16px 20px;
}
.gh-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.gh-head .link { font-size: 14px; }

.gh-card { position: relative; padding: 22px 24px 18px; border: 1px solid var(--line); background: var(--bg); }
.gh-total { margin: 0 0 18px; font-size: 16px; }
.gh-total strong { font-weight: 500; }

.gh-scroll { overflow-x: auto; padding-bottom: 4px; }
.gh-graph {
  --cell: 12px; --gap: 3px;
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: 18px auto;
  width: max-content;
}
.gh-months { grid-column: 2; position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.gh-months span { position: absolute; top: 0; }
.gh-days { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(7, var(--cell)); gap: var(--gap); font-size: 10px; color: var(--muted); }
.gh-days span { line-height: var(--cell); }
.gh-cells {
  grid-column: 2; grid-row: 2;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-columns: var(--cell);
  gap: var(--gap);
}
.gh-cells i, .gh-legend i { display: block; width: var(--cell, 12px); height: var(--cell, 12px); }


.l0 { background: color-mix(in srgb, var(--text) 7%, transparent); }
.l1 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.l2 { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.l3 { background: color-mix(in srgb, var(--accent) 80%, transparent); }
.l4 { background: var(--accent); }
.gh-cells i.empty { background: none; }
.gh-cells i:not(.empty):hover { outline: 1px solid var(--text); outline-offset: 1px; }
.gh-cells i.new { animation: gh-in .4s ease both; }
@keyframes gh-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

.gh-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.gh-legend { display: inline-flex; align-items: center; gap: 3px; }
.gh-legend i { width: 10px; height: 10px; }
.gh-legend i:first-of-type { margin-left: 4px; }
.gh-legend i:last-of-type { margin-right: 4px; }

.gh-tip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 5px 9px; font-size: 12px; white-space: nowrap;
  background: var(--text); color: var(--bg);
  transform: translate(-50%, calc(-100% - 8px));
}


.contact-direct { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
.contact-direct li { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-direct li > span { font-size: 12px; color: var(--muted); }
.contact-direct a { justify-self: start; font-size: 15px; word-break: break-all; }
.socials a[hidden] { display: none; }


[data-scramble] { display: inline-block; white-space: pre; font-variant-ligatures: none; }


.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: 300px;
  padding: 36px 90px 36px 32px;
}
.project-card.featured .project-info h3 { font-size: 22px; letter-spacing: -0.03em; }
.project-card.featured .project-info p { max-width: 46ch; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.badge { padding: 3px 8px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.badge.live { color: var(--text); border-color: var(--accent); }
.badge.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: var(--accent); vertical-align: 1px; }
.stack { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; font: 12px ui-monospace, Consolas, monospace; color: var(--muted); }
.stack span::before { content: "/ "; color: var(--accent); }


.float-win {
  justify-self: center;
  width: min(100%, 340px);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 5%, var(--bg));
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 0 0 6px color-mix(in srgb, var(--text) 3%, transparent);
  overflow: hidden;
  transform: rotate(-2deg);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.project-card.featured:hover .float-win { transform: rotate(0) translateY(-6px); }
.fw-bar { display: flex; align-items: center; gap: 5px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.fw-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .5; }
.fw-bar i:first-child { background: var(--accent); opacity: 1; }
.fw-tab { margin-left: 6px; padding: 3px 8px; font-size: 10px; color: var(--muted); border-radius: 6px; }
.fw-tab.on { color: var(--text); background: var(--panel-2); }
.fw-body { display: grid; gap: 10px; padding: 14px; }
.fw-msg { max-width: 80%; padding: 8px 10px; border-radius: 10px; font-size: 11px; }
.fw-msg.you { justify-self: end; background: var(--text); color: var(--bg); }
.fw-msg.ai { display: grid; gap: 6px; width: 75%; background: var(--panel-2); }
.fw-msg.ai b { display: block; height: 6px; border-radius: 3px; background: var(--muted); opacity: .45; }
.fw-msg.ai b.short { width: 55%; }
.fw-code { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font: 11px ui-monospace, Consolas, monospace; color: var(--text); }
.fw-code .k { color: var(--accent); } .fw-code .s { color: var(--muted); }
.fw-input { display: flex; justify-content: space-between; align-items: center; margin: 0 14px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; color: var(--muted); }
.fw-input i { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); }

@media (max-width: 860px) {
  .project-card.featured { grid-template-columns: 1fr; padding: 28px 24px 32px; gap: 28px; }
  .project-card.featured .arrow { top: 28px; right: 24px; }
}
