/* ==========================================================================
   mtuna.dev — Three.js developer portfolio (light theme, solid vivid colors)
   ========================================================================== */

/* Local fallback tuned to Montserrat's metrics, so the late web-font swap doesn't shift layout */
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial");
  ascent-override: 85.79%;
  descent-override: 22.25%;
  line-gap-override: 0%;
  size-adjust: 112.83%;
}

:root {
  --bg: #f6f6fa;
  --surface: #ffffff;
  --text: #0e0e1a;
  --muted: #4f4f66;
  --dim: #64647a;
  --line: rgba(14, 14, 26, 0.1);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.92);

  /* Vivid solid palette */
  --pink: #ff1675;
  --violet: #6b2cff;
  --blue: #0a84ff;
  --mint: #00c781;
  --amber: #ff9f0a;
  --orange: #ff5a1f;
  --accent: var(--violet);

  /* Deeper tones of the palette for text/badges (WCAG AA contrast on white) */
  --pink-ink: #d6005c;
  --blue-ink: #0062d1;
  --mint-ink: #007a4d;
  --orange-ink: #c23a00;

  --font: "Montserrat", "Montserrat Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: 1240px;
  --radius: 22px;
  --shadow: 0 18px 50px -24px rgba(14, 14, 26, 0.25);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; position: relative; }

/* Accent text is a single solid color (no gradients) */
.grad,
.accent { color: var(--violet); }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

/* ==========================================================================
   WebGL canvas, icons, cursor, progress
   ========================================================================== */

#webgl {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.no-webgl #webgl { display: none; }
#webgl { opacity: 0; transition: opacity 1.2s ease; }
.scene-on #webgl { opacity: 1; }

.ic {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* On phones the particles sit behind the text, so a light veil keeps it readable */
.scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none; display: none; }

@media (max-width: 900px) {
  .scrim { display: block; background: rgba(246, 246, 250, .55); transition: opacity .8s; }
  .at-hero .scrim { opacity: 0; }
}

main, .header, .dots, .progress { position: relative; z-index: 2; }

.cursor { position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; display: none; }
.cursor span { position: fixed; top: 0; left: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-dot { width: 7px; height: 7px; background: var(--violet); }
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(14, 14, 26, .35);
  transition: width .35s var(--ease), height .35s var(--ease), background-color .35s, border-color .35s;
}
.cursor.hover .cursor-ring { width: 70px; height: 70px; background: rgba(107, 44, 255, .1); border-color: var(--violet); }
.cursor.drag .cursor-ring { width: 90px; height: 90px; border-color: var(--pink); background: rgba(255, 22, 117, .08); }

@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
  body, a, button, [role="button"] { cursor: none; }
}

.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--violet); }

/* ==========================================================================
   Header + section dots
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 32px;
  transition: padding .4s var(--ease), background-color .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  padding: 14px 32px;
  background: rgba(255, 255, 255, .8);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }
.logo img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--violet); }

.nav { display: flex; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .75); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.nav a { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .3s, background-color .3s; }
.nav a:hover { color: var(--text); background: rgba(14, 14, 26, .06); }
.nav a.active { color: #fff; background: var(--violet); }

.header-right { display: flex; align-items: center; gap: 12px; }

.lang { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .75); }
.lang button { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--dim); transition: background-color .3s, color .3s; }
.lang button.active { background: var(--text); color: #fff; }
.lang button:not(.active):hover { color: var(--text); }

.dots {
  position: fixed;
  right: 26px;
  top: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(-50%);
}

.dots a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-size: 11px; font-weight: 800; color: var(--dim); }
.dots a::after { content: ""; width: 18px; height: 3px; border-radius: 3px; background: currentColor; transition: width .4s var(--ease), background-color .4s; }
.dots a span { opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .3s; }
.dots a:hover span,
.dots a.active span { opacity: 1; transform: none; }
.dots a.active { color: var(--text); }
.dots a.active::after { width: 36px; background: var(--violet); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--violet);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 14px 30px -12px rgba(107, 44, 255, .75);
  transition: background-color .4s, box-shadow .4s, transform .4s var(--ease);
}

.btn:hover { background: var(--pink); box-shadow: 0 16px 34px -12px rgba(255, 22, 117, .75); }

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--text);
  box-shadow: none;
}

.btn-ghost:hover { background: var(--text); color: #fff; box-shadow: none; }

.btn-small { padding: 10px 18px; font-size: 13px; }

/* ==========================================================================
   Reveal + split-text animations
   ========================================================================== */

.js .reveal-up { transform: translateY(36px); transition: transform 1s var(--ease); }
.js .reveal-up.in { transform: none; }

/* Extra top/bottom room (offset by negative margin) keeps accents like Ü from being clipped */
.split { display: block; overflow: hidden; padding: .14em 0 .06em; margin: -.14em 0 -.06em; }
.split .ch { display: inline-block; will-change: transform; }
.js .split .ch { transform: translateY(115%) rotate(6deg); transition: transform .8s var(--ease); transition-delay: calc(var(--i) * 35ms); }
.ready .split .ch { transform: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 90px; }

.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mint); animation: pulse 2s ease-out infinite; }
@keyframes pulse { to { transform: scale(3); opacity: 0; } }

.hero-title {
  margin: 26px 0 22px;
  font-size: clamp(54px, 8.4vw, 150px);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* "TUNA" is assembled by a particle effect (app.js); the real text fades in once it lands */
.hero-title { position: relative; }
.tuna-word { display: block; }
.js .tuna-word.pending { clip-path: inset(-20% 100% -20% 0); }
.tuna-canvas { position: absolute; z-index: 1; pointer-events: none; }

.hero-lead { max-width: 520px; font-size: 19px; line-height: 1.65; color: var(--muted); font-weight: 500; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero-social { display: flex; gap: 10px; margin-top: 36px; }
.hero-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  transition: color .3s, border-color .3s, transform .4s var(--ease), background-color .3s;
}
.hero-social a:nth-child(1):hover { background: var(--blue); }
.hero-social a:nth-child(2):hover { background: var(--text); }
.hero-social a:nth-child(3):hover { background: var(--pink); }
.hero-social a:hover { color: #fff; border-color: transparent; transform: translateY(-3px); }

.hero-stage { position: relative; height: min(76vh, 720px); display: grid; place-items: center; }

/* Cut-out portrait popping out of a solid circle */
.portrait { position: relative; width: min(500px, 100%); aspect-ratio: 1 / 1.12; }
.portrait-circle { position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1; border-radius: 50%; background: var(--violet); box-shadow: 0 40px 80px -30px rgba(107, 44, 255, .6); }
.portrait-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 0 0 50% 50% / 0 0 44.64% 44.64%; }
.portrait-clip img { position: absolute; left: 50%; bottom: 0; width: 104%; height: auto; max-width: none; transform: translateX(-50%); }
.portrait-dot { position: absolute; z-index: 1; border-radius: 50%; }
.portrait-dot.d1 { width: 64px; height: 64px; right: 2%; top: 22%; background: var(--pink); }
.portrait-dot.d2 { width: 34px; height: 34px; left: 4%; top: 30%; background: var(--amber); }
.portrait-dot.d3 { width: 22px; height: 22px; left: 14%; bottom: 8%; background: var(--mint); }


.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
  transform: translateX(-50%);
}

.scroll-hint i { position: relative; width: 22px; height: 36px; border: 1.5px solid rgba(14, 14, 26, .3); border-radius: 12px; }
.scroll-hint i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; border-radius: 2px; background: var(--violet); transform: translateX(-50%); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translate(-50%, 0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 12px); } }

/* ==========================================================================
   Sections (shared)
   ========================================================================== */

.section { position: relative; padding: 150px 0; }

.kicker { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; font-size: 13px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.kicker span:first-child { padding: 4px 10px; border-radius: 999px; color: #fff; background: var(--k, var(--violet)); letter-spacing: .05em; }
.kicker::after { content: ""; width: 60px; height: 3px; border-radius: 3px; background: var(--k, var(--violet)); }

#about { --k: var(--pink-ink); }
#skills { --k: var(--violet); }
#experience { --k: var(--blue-ink); }
#education { --k: var(--mint-ink); }
#work { --k: var(--orange-ink); }
#contact { --k: var(--pink-ink); }

.title { max-width: 820px; font-size: clamp(38px, 5.6vw, 76px); font-weight: 900; line-height: 1.02; letter-spacing: -0.035em; }

.sub { margin-top: 18px; font-size: 18px; font-weight: 600; color: var(--muted); }

/* About */
.about-text { max-width: 640px; margin-top: 36px; font-size: 20px; line-height: 1.75; color: var(--muted); font-weight: 500; }
.about-text img { display: inline-block; width: 32px; height: 32px; margin: 0 6px 0 2px; border-radius: 50%; object-fit: cover; vertical-align: middle; position: relative; top: -2px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pink); }
.about-text b { font-weight: 800; color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 640px; margin-top: 56px; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: 24px 22px; border-top: 4px solid var(--c); }
.stat:nth-child(1) { --c: var(--pink-ink); }
.stat:nth-child(2) { --c: var(--violet); }
.stat:nth-child(3) { --c: var(--mint-ink); }
.stat-num { font-size: clamp(38px, 4.2vw, 54px); font-weight: 900; line-height: 1; letter-spacing: -0.04em; color: var(--c); }
.stat-label { font-size: 13px; font-weight: 700; color: var(--muted); }

/* Skills */
.marquee { position: absolute; top: 40px; left: 0; right: 0; overflow: hidden; pointer-events: none; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track span::before { content: attr(data-t); }
.marquee-track span { font-size: clamp(48px, 7vw, 96px); font-weight: 900; letter-spacing: -0.03em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1.5px rgba(107, 44, 255, .16); }
@keyframes marquee { to { transform: translateX(-50%); } }

.skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 900px; margin-top: 56px; }

.skill-card { padding: 28px; }
.skill-card h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 19px; font-weight: 800; }
.ic-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 18px; color: #fff; background: var(--c, var(--violet)); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: border-color .3s, background-color .3s, transform .3s var(--ease), color .3s;
}
.chip:hover { border-color: var(--c, var(--violet)); background: var(--c, var(--violet)); color: #fff; transform: translateY(-2px); }
.chip .badge-ic { color: var(--orange-ink); font-size: 14px; }
.chip:hover .badge-ic { color: #fff; }

/* Experience timeline */
.timeline-wrap { position: relative; max-width: 860px; margin-top: 64px; }
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: rgba(14, 14, 26, .08); }
.line-fill { position: absolute; z-index: 1; left: 7px; top: 8px; width: 3px; height: 0; border-radius: 3px; background: var(--blue); }

.tl-item { position: relative; padding-bottom: 26px; }
.tl-item::before { content: ""; position: absolute; left: -40px; top: 30px; z-index: 1; width: 17px; height: 17px; border-radius: 50%; background: var(--c, var(--violet)); box-shadow: 0 0 0 5px var(--bg); }

.tl-card { padding: 26px 28px; border-left: 4px solid var(--c, var(--violet)); transition: border-color .4s, transform .5s var(--ease), background-color .4s; }
.tl-item:hover .tl-card { background: #fff; transform: translateX(6px); }

.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.tl-card h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.tl-date { font-size: 13px; font-weight: 800; color: var(--c, var(--violet)); white-space: nowrap; }
.tl-date small { font-weight: 600; color: var(--dim); }
.tl-company { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tl-company b { color: var(--text); font-weight: 800; }
.tl-desc { margin-top: 14px; font-size: 15px; color: var(--muted); font-weight: 500; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag-pill { padding: 4px 10px; border-radius: 999px; background: rgba(14, 14, 26, .05); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--text); }

/* Education */
.edu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 900px; margin-top: 56px; }
.edu-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 30px; overflow: hidden; border-top: 4px solid var(--c, var(--violet)); }
.edu-card.wide { grid-column: 1 / -1; }
.edu-card h3 { font-size: 22px; font-weight: 800; }
.edu-degree { font-weight: 700; color: var(--text); }
.edu-desc { font-size: 15px; color: var(--muted); font-weight: 500; }
.edu-period { margin-top: 10px; font-size: 13px; font-weight: 800; color: var(--c, var(--violet)); }
.edu-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.edu-badges span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; background: var(--orange-ink); color: #fff; font-size: 13px; font-weight: 800; }

/* Work */
.work-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .8); }
.filters button { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .3s, background-color .3s; }
.filters button.active { background: var(--orange-ink); color: #fff; }
.filters button:not(.active):hover { color: var(--text); }

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 48px; perspective: 1200px; }

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform .5s var(--ease), border-color .4s, box-shadow .4s;
  cursor: pointer;
  animation: cardIn .7s var(--ease) both;
}

.work-card[hidden] { display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

.work-card:hover { border-color: var(--accent); box-shadow: 0 30px 60px -28px var(--accent); }

.work-visual { position: relative; aspect-ratio: 4 / 3.3; overflow: hidden; }
.work-info { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px 24px; }
.work-type { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.work-info h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.work-more::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.work-more { padding: 0; font: inherit; text-align: left; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--text); transition: color .3s, gap .3s var(--ease); }
.work-card:hover .work-more { color: var(--accent); gap: 12px; }

/* Phone / browser mockups inside cards: flat vivid backgrounds */
.mock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--accent); }
.mock::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; right: -18%; top: -24%; border-radius: 50%; background: var(--accent-2); }
.mock::after { content: ""; position: absolute; width: 34%; aspect-ratio: 1; left: -8%; bottom: -12%; border-radius: 50%; background: rgba(255, 255, 255, .22); }

.phone {
  position: relative;
  z-index: 1;
  width: 38%;
  aspect-ratio: 9 / 18.5;
  padding: 6px;
  border-radius: 28px;
  background: #0e0e1a;
  box-shadow: 0 30px 50px -20px rgba(14, 14, 26, .6);
  transform: rotate(-10deg) translateY(12%);
  transition: transform .8s var(--ease);
}
.phone::before { content: ""; position: absolute; top: 12px; left: 50%; z-index: 2; width: 30%; height: 10px; border-radius: 10px; background: #0e0e1a; transform: translateX(-50%); }
.screen { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; border-radius: 22px; background: #fff; }
.screen-head { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; height: 36%; padding: 12%; background: var(--accent); color: #fff; }
.screen-head .ic { font-size: clamp(14px, 1.6vw, 22px); }
.screen-head strong { font-size: clamp(10px, .9vw, 14px); font-weight: 800; line-height: 1.1; }
.screen-body { display: flex; flex-direction: column; gap: 7px; padding: 10%; }
.sk-row { display: flex; align-items: center; gap: 7px; padding: 6px; border-radius: 9px; background: #f1f1f7; }
.sk-dot { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); }
.sk-lines { flex: 1; display: grid; gap: 4px; }
.sk-line { height: 4px; border-radius: 4px; background: #d9d9e6; }
.sk-line.short { width: 60%; }

.browser { position: relative; z-index: 1; width: 78%; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 30px 50px -20px rgba(14, 14, 26, .6); transform: perspective(900px) rotateY(-12deg) rotateX(5deg); transition: transform .8s var(--ease); }
.browser-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #f1f1f7; }
.browser-bar span { width: 7px; height: 7px; border-radius: 50%; background: #c9c9d8; }
.browser-bar em { margin-left: 6px; padding: 2px 8px; border-radius: 5px; background: #fff; font-size: 9px; font-style: normal; font-weight: 700; color: var(--muted); }
.browser-hero { display: flex; align-items: center; gap: 8px; padding: 14px; background: var(--accent); color: #fff; }
.browser-hero strong { font-size: 13px; font-weight: 800; }
.browser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 10px; }
.browser-grid div { aspect-ratio: 1; border-radius: 7px; background: #f1f1f7; }
.browser-grid div:nth-child(2) { background: var(--accent-2); }

.work-card:hover .phone { transform: rotate(-4deg) translateY(6%) scale(1.05); }
.work-card:hover .browser { transform: perspective(900px) rotateY(0) rotateX(0) scale(1.04); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 14, 26, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s, visibility .35s;
}
.modal.open { opacity: 1; visibility: visible; transition: opacity .35s, visibility 0s; }

.modal-box {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  transform: translateY(24px) scale(.98);
  transition: transform .45s var(--ease);
}
.modal.open .modal-box { transform: none; }
.modal-visual { position: relative; min-height: 380px; }
.modal-body { padding: 44px 38px 38px; }
.modal-type { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--violet); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.modal-body h3 { margin-top: 14px; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.modal-meta { margin-top: 6px; font-weight: 700; color: var(--muted); }
.modal-desc { margin-top: 18px; color: var(--muted); font-weight: 500; }
.modal-body h4 { margin-top: 24px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 5; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--text); box-shadow: var(--shadow); transition: background-color .3s, color .3s, transform .4s var(--ease); }
.modal-close:hover { background: var(--pink); color: #fff; transform: rotate(90deg); }

/* Contact */
.contact { padding-bottom: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; }
.contact-title { max-width: 980px; font-size: clamp(44px, 7.4vw, 112px); font-weight: 900; line-height: .98; letter-spacing: -0.045em; }
.contact-title .grad { color: var(--pink); }
.contact .sub { max-width: 560px; }

.contact-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 44px; }
.mail-link { position: relative; font-size: clamp(24px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; transition: color .3s; }
.mail-link::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 4px; border-radius: 4px; background: var(--pink); transform-origin: right; transform: scaleX(.25); transition: transform .6s var(--ease); }
.mail-link:hover { color: var(--pink); }
.mail-link:hover::after { transform-origin: left; transform: scaleX(1); }

.contact-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 900px; margin-top: 56px; }
.contact-links > * { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 20px 22px; transition: border-color .3s, transform .4s var(--ease), background-color .3s; }
.contact-links .ic-box { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; font-size: 18px; }
.contact-links > :nth-child(1) .ic-box { background: var(--blue); }
.contact-links > :nth-child(2) .ic-box { background: var(--text); }
.contact-links > :nth-child(3) .ic-box { background: var(--mint); }
.contact-links span { font-weight: 800; }
.contact-links small { font-size: 13px; font-weight: 600; color: var(--muted); }
.contact-links a:hover { border-color: var(--violet); transform: translateY(-4px); }

.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 120px; padding-top: 28px; padding-bottom: 28px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.to-top { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; transition: color .3s; }
.to-top:hover { color: var(--violet); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .nav { display: none; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  .header,
  .header.scrolled { padding-left: 22px; padding-right: 22px; }
  .dots { display: none; }

  .hero { padding-top: 110px; padding-bottom: 70px; }
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-stage { height: auto; min-height: 0; margin-top: 40px; }
  .portrait { width: min(420px, 88%); }
  .scroll-hint { display: none; }

  .section { padding: 110px 0; }
  .skill-grid,
  .edu-grid,
  .contact-links { grid-template-columns: 1fr; }
  .modal-box { grid-template-columns: 1fr; }
  .modal-visual { min-height: 260px; }
  .modal-body { padding: 28px 24px 30px; }
}

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .btn-small { padding: 10px 13px; }
  .work-grid { grid-template-columns: 1fr; }
  .hero-lead { font-size: 17px; }
  .about-text { font-size: 17px; }
  .timeline { padding-left: 30px; }
  .tl-item::before { left: -30px; width: 15px; height: 15px; }
  .timeline::before,
  .line-fill { left: 5px; }
  .tl-card { padding: 22px; }
  .footer { margin-top: 80px; }
  .stats { gap: 10px; }
  .stat { padding: 18px 14px; }
  .stat-label { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal-up { transform: none; }
  .js .tuna-word.pending { clip-path: none; }
  .js .split .ch { transform: none; }
}
