/* ==========================================================================
   Manga portfolio - Jitin Kumar Sengar
   Cool paper, heavy ink outlines, halftone dots, one crimson accent.
   ========================================================================== */

:root {
  --paper: #ecebe6;
  --paper-2: #dedcd3;
  --card: #f8f7f2;
  --ink: #14161f;
  --ink-soft: #4a4f5e;
  --accent: #d62839;
  --accent-soft: #dde3f2;
  --indigo: #26358c;
  --sun: #f2b705;

  --font-head: 'Archivo', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-hand: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 14px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: var(--line);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--font-head); font-weight: 900; font-size: 1.5rem; text-decoration: none; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  text-decoration: none; padding: 6px 12px; border-radius: 999px;
  border: 2px solid transparent;
}
.nav-links a:hover { border-color: var(--ink); background: var(--accent-soft); }
.nav-toggle {
  display: none; font: 700 .9rem var(--font-head);
  padding: 6px 14px; border: var(--line); border-radius: 999px;
  background: var(--card); cursor: pointer;
}

/* ---------- Shared pieces ---------- */
.panel {
  background: var(--card);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.btn {
  display: inline-block; font: 700 .95rem var(--font-head);
  text-decoration: none; cursor: pointer;
  padding: 10px 20px; border: var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { box-shadow: none; border-style: dashed; }
.btn.small { padding: 4px 14px; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.ico { display: inline-flex; vertical-align: -0.2em; line-height: 0; }
.ico svg { width: 1.15em; height: 1.15em; }
.steps li > span .ico svg { width: 22px; height: 22px; color: var(--ink); }
.trophy .ico svg { width: 38px; height: 38px; color: var(--accent); }
.skill h3 .ico { margin-right: 4px; color: var(--accent); }
.eco-layer-head .ico { color: var(--accent); }
.eco-layer-head .ico svg { width: 24px; height: 24px; }
.private-note .ico svg { width: 1em; height: 1em; }

:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; }

.hand-note { font-family: var(--font-hand); font-size: 1.35rem; color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li, .chip {
  font-size: .8rem; font-weight: 600; padding: 3px 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--paper);
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
  background-image: radial-gradient(rgba(34,31,31,.13) 1.4px, transparent 1.6px);
  background-size: 14px 14px;
  border-bottom: var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.2; margin: 6px 0 18px;
}
.hero h1 mark {
  background: linear-gradient(transparent 58%, var(--sun) 58%);
  color: inherit; padding: 0 2px;
}
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 58ch; }
.lead strong, .lead em { color: var(--ink); }

.hero-art { position: relative; max-width: 380px; justify-self: center; }
.portrait { padding: 8px; rotate: 1.5deg; }
.portrait img { border-radius: 8px; width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; }
.polaroid {
  position: absolute; left: -44px; bottom: -28px; width: 130px;
  background: #fff; border: var(--line); padding: 7px 7px 4px;
  box-shadow: 4px 4px 0 var(--ink); rotate: -7deg;
}
.polaroid img { aspect-ratio: 1; object-fit: cover; object-position: top; border: 2px solid var(--ink); }
.polaroid figcaption { font-family: var(--font-hand); font-size: .9rem; text-align: center; padding-top: 3px; }
.bubble {
  position: absolute; top: -20px; right: -26px;
  font-family: var(--font-hand); font-size: 1.05rem;
  background: #fff; border: var(--line); border-radius: 22px; padding: 8px 16px;
  box-shadow: 3px 3px 0 var(--ink); rotate: 4deg;
}
.bubble::after {
  content: ""; position: absolute; left: 22px; bottom: -14px;
  width: 16px; height: 16px; background: #fff;
  border-right: var(--line); border-bottom: var(--line);
  transform: rotate(45deg) skew(10deg, 10deg);
}

/* ---------- Facts ---------- */
.facts { background: var(--ink); color: var(--paper); border-bottom: var(--line); }
.facts-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.fact { text-align: center; }
.fact b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 2.2rem; color: var(--sun); line-height: 1.1; }
.fact span { font-size: .85rem; opacity: .85; }

/* ---------- Sections ---------- */
.block { padding: 72px 0; border-bottom: var(--line); }
.block.alt { background: var(--paper-2); }
.sec-head { margin-bottom: 36px; }
.chapter {
  display: inline-block; font-family: var(--font-hand); font-size: 1.1rem;
  background: var(--accent); color: #fff; padding: 1px 14px;
  border: 2px solid var(--ink); border-radius: 6px; transform: rotate(-2deg); margin-bottom: 10px;
}
.sec-head h2 { font-family: var(--font-head); font-weight: 900; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.2; }
.sec-desc { color: var(--ink-soft); margin-top: 8px; max-width: 60ch; }
.sub-head { font-family: var(--font-head); font-weight: 900; font-size: 1.5rem; margin: 64px 0 20px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start; }
.about-text p + p { margin-top: 14px; }
.how-agent h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 14px; }
.steps { display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps li > span {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  font-size: 1.3rem; background: var(--accent-soft); border: 2px solid var(--ink); border-radius: 50%;
}
.steps b { display: block; font-family: var(--font-head); }
.steps small { color: var(--ink-soft); font-size: .88rem; }

/* ---------- Autourgos ---------- */
.auto-banner { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 40px; align-items: stretch; }
.auto-banner h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 10px; }
.auto-banner > .panel:first-child { display: flex; flex-direction: column; }
.auto-banner > .panel:first-child .btn-row { margin-top: auto; padding-top: 22px; }
.feat-list { display: grid; gap: 10px; margin-top: 16px; }
.feat-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); line-height: 1.5; }
.feat-list .ico { flex: none; margin-top: 2px; color: var(--accent); }
.feat-list .ico svg { width: 18px; height: 18px; stroke-width: 3; }
.install {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding: 8px 8px 8px 14px;
  background: var(--ink); color: var(--paper); border-radius: 10px;
}
.install code { font-family: var(--font-mono); font-size: .88rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.install .btn { box-shadow: none; border-width: 2px; }
.code {
  font-family: var(--font-mono); font-size: .85rem; line-height: 1.8;
  background: var(--ink); color: #f1e9db; overflow-x: auto; white-space: pre;
}
.code .cm { color: #9a9086; } .code .kw { color: #ff9eb1; } .code .fn { color: var(--sun); } .code .str { color: #a8d8a0; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.tab {
  font: 700 .9rem var(--font-head); padding: 6px 16px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink);
}
.tab:hover { background: var(--accent-soft); }
.tab.active { background: var(--ink); color: var(--paper); }

.eco-layers { display: grid; gap: 30px; }
.eco-layer-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.eco-layer-head h4 { font-family: var(--font-head); font-size: 1.2rem; }
.eco-pkgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pkg {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 16px;
}
.pkg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pkg-name { font-family: var(--font-mono); font-weight: 700; font-size: .85rem; text-decoration: none; word-break: break-all; }
.pkg-name:hover { color: var(--accent); }
.pkg-ver { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-soft); }
.pkg p { font-size: .88rem; color: var(--ink-soft); margin-top: 6px; line-height: 1.55; }
.pkg-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; }
.pkg-foot a { font-weight: 700; margin-left: 10px; }

/* ---------- Projects ---------- */
.project-stack { display: grid; gap: 40px; }
.project { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; }
.project:nth-child(even) .project-art { order: -1; }
.project-no { font-family: var(--font-hand); color: var(--accent); font-size: 1.1rem; }
.project h3 { font-family: var(--font-head); font-weight: 900; font-size: 1.7rem; line-height: 1.2; margin-bottom: 8px; }
.project p { color: var(--ink-soft); }
.project .chips { margin-top: 14px; }
.project details { margin-top: 16px; border: 2px dashed var(--ink); border-radius: 10px; padding: 10px 14px; }
.project summary { font-family: var(--font-head); font-weight: 700; cursor: pointer; }
.detail-body { margin-top: 10px; font-size: .92rem; }
.detail-body h5 { font-family: var(--font-hand); font-size: 1.05rem; color: var(--accent); margin: 10px 0 4px; }
.detail-body ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-soft); }
.project-art { padding: 8px; transform: rotate(1deg); }
.project:nth-child(even) .project-art { transform: rotate(-1deg); }
.project-art img { border-radius: 8px; border: 2px solid var(--ink); }
.art-fallback {
  aspect-ratio: 4/3; display: grid; place-items: center; border-radius: 8px; border: 2px solid var(--ink);
  background-color: var(--accent-soft);
  background-image: radial-gradient(rgba(34,31,31,.2) 1.4px, transparent 1.6px);
  background-size: 12px 12px;
  font-family: var(--font-head); font-weight: 900; font-size: 4rem; color: var(--ink);
}
.private-note { display: inline-block; font-size: .85rem; font-weight: 600; padding: 8px 4px; color: var(--ink-soft); }

.aux-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.aux { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 20px; box-shadow: 4px 4px 0 var(--ink); }
.aux h4 { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: 4px; }
.aux p { font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }
.aux-links { display: flex; gap: 8px; }

/* ---------- Team & achievements ---------- */
.contrib h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 14px; }
.contrib-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px; }
.contrib-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-soft); }
.contrib-list li b { color: var(--ink); font-family: var(--font-head); }
.contrib-list .ico { flex: none; margin-top: 2px; color: var(--accent); }
.contrib-list .ico svg { width: 24px; height: 24px; }

.achievements { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.achievement { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; background: var(--ink); border-bottom: var(--line); }
.shot { border: 0; padding: 0; cursor: zoom-in; background: var(--paper-2); aspect-ratio: 4/3; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform .3s; }
.shot:hover img { transform: scale(1.05); }
.ach-body { padding: 22px 24px 26px; }
.ach-badge {
  display: inline-flex; align-items: center; gap: 6px; font: 700 .85rem var(--font-head);
  background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px;
}
.ach-body h3 { font-family: var(--font-head); font-weight: 900; font-size: 1.5rem; margin: 10px 0 2px; }
.ach-meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: 10px; }
.ach-body p { color: var(--ink-soft); }
.ach-body .ach-team { margin-top: 12px; font-size: .9rem; color: var(--ink-soft); border-top: 2px dashed var(--ink); padding-top: 10px; }
.ach-team b { color: var(--ink); font-family: var(--font-head); }
.team-foot { margin-top: 32px; color: var(--ink-soft); max-width: 70ch; }

.lightbox { margin: auto; max-width: 92vw; max-height: 92vh; border: var(--line); border-radius: var(--radius); background: var(--card); padding: 10px; box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(34,31,31,.75); }
.lightbox img { max-width: 100%; max-height: calc(92vh - 70px); margin: 0 auto; border-radius: 8px; }
.lightbox-close { display: block; margin: 0 0 8px auto; font: 700 .85rem var(--font-head); padding: 4px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.skill-wide { grid-column: 1 / -1; }
.tool-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px 28px; margin-top: 10px; }
.tool-groups .skill-proof { margin: 0 0 10px; }
.skill h3 { font-family: var(--font-head); font-size: 1.25rem; }
.skill-proof { font-family: var(--font-hand); color: var(--accent); margin: 2px 0 14px; }

/* ---------- Contact ---------- */
.contact-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-family: var(--font-head); font-weight: 700; font-size: .92rem; }
.form input, .form textarea {
  font: 500 1rem var(--font-body); padding: 10px 14px; color: var(--ink);
  background: #fff; border: 2px solid var(--ink); border-radius: 10px;
}
.form textarea { min-height: 130px; resize: vertical; }
.form-note { color: var(--ink-soft); }
.contact-side ul { display: grid; gap: 10px; margin-top: 8px; }
.contact-side a { font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 28px 0; font-family: var(--font-hand); color: var(--ink-soft); }

/* ---------- Scroll reveal (subtle) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.reveal.revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .auto-banner, .project, .contact-card, .edu-grid { grid-template-columns: minmax(0, 1fr); }
  .project:nth-child(even) .project-art { order: 0; }
  .hero-art { margin-top: 20px; max-width: 300px; }
  .facts-row { grid-template-columns: repeat(2, 1fr); }
  .achievements, .contrib-list, .skills-grid, .tool-groups { grid-template-columns: minmax(0, 1fr); }

  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 10px 20px 16px;
    background: var(--paper); border-bottom: var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 8px; }
}

@media (max-width: 480px) {
  .polaroid { left: -10px; width: 100px; }
  .bubble { right: -6px; font-size: .95rem; }
  .block { padding: 52px 0; }
}

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.edu-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.edu-art { aspect-ratio: 16/9; border-bottom: var(--line); background: var(--paper-2); overflow: hidden; }
.edu-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.edu-art .art-fallback { height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; font-size: 3.2rem; }
.edu-body { padding: 20px 24px 24px; }
.edu-body h3 { font-family: var(--font-head); font-weight: 900; font-size: 1.3rem; line-height: 1.3; margin: 10px 0 4px; }
.edu-school { font-weight: 600; }
.ach-badge.now { background: var(--accent-soft); }

/* ---------- Generated project art ---------- */
.art-card { border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--tint, var(--accent-soft)); }
.art-bar { display: flex; gap: 6px; padding: 8px 10px; background: var(--card); border-bottom: 2px solid var(--ink); }
.art-bar i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); }
.art-main {
  aspect-ratio: 4/3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center;
  background-image: radial-gradient(rgba(34,31,31,.16) 1.4px, transparent 1.6px); background-size: 12px 12px;
}
.art-icon { display: grid; place-items: center; width: 84px; height: 84px; background: var(--card); border: var(--line); border-radius: 50%; box-shadow: 4px 4px 0 var(--ink); }
.art-icon .ico svg { width: 40px; height: 40px; color: var(--ink); }
.art-main strong { font-family: var(--font-head); font-weight: 900; font-size: 1.6rem; line-height: 1.2; }
.art-main .chips { justify-content: center; }

/* Let grid/flex children shrink so wide code never pushes the page sideways */
.auto-banner > *, .project > *, .about-grid > *, .contact-card > *, .achievements > *, .edu-grid > * { min-width: 0; }
.install code { min-width: 0; }
@media (max-width: 900px) { .edu-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Anime cursor (fine pointers only) ---------- */
@media (pointer: fine) {
  html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M4 3 L4 24 L9.5 19 L13 27 L16.5 25.5 L13 18 L20.5 18 Z' fill='%23d62839' stroke='%2314161f' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M7 9 L7 16' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' opacity='.7'/%3E%3Cpath d='M25 3 l1.6 3.6 3.6 1.6 -3.6 1.6 -1.6 3.6 -1.6 -3.6 -3.6 -1.6 3.6 -1.6z' fill='%23f2b705' stroke='%2314161f' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto; }
  a, button, summary, .project summary, .shot, .btn, .tab, .nav-toggle, .lightbox-close, label[for], [role="button"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 L19 13 L30 16 L19 19 L16 30 L13 19 L2 16 L13 13 Z' fill='%23d62839' stroke='%2314161f' stroke-width='1.8' stroke-linejoin='round'/%3E%3Ccircle cx='16' cy='16' r='2.4' fill='%23fff' stroke='%2314161f' stroke-width='1.2'/%3E%3C/svg%3E") 16 16, pointer; }
  input, textarea { cursor: text; }
}

.spark {
  position: fixed; z-index: 100; width: 12px; height: 12px; pointer-events: none;
  background: var(--accent); border: 2px solid var(--ink); border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: spark-fly .7s ease-out forwards;
}
@keyframes spark-fly {
  from { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(.5); }
}
@media (prefers-reduced-motion: reduce) { .spark { display: none; } }

/* ---------- Active nav item ---------- */
.nav-links a { display: inline-flex; align-items: center; gap: 6px; }
.nav-links a.active { background: var(--accent-soft); border-color: var(--ink); }


/* ---------- Wide achievement card (certificate) ---------- */
.ach-wide { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
.ach-wide .cert { flex: 0 0 48%; background: var(--paper-2); border-right: var(--line); display: grid; place-items: center; padding: 14px; }
.ach-wide .cert .shot { aspect-ratio: auto; width: 100%; background: none; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.ach-wide .cert .shot img { height: auto; object-fit: contain; }
.ach-wide .ach-body { flex: 1; align-self: center; min-width: 0; }
.ach-wide h3 { font-size: 1.3rem; line-height: 1.35; }
@media (max-width: 900px) {
  .ach-wide { flex-direction: column; }
  .ach-wide .cert { flex-basis: auto; border-right: 0; border-bottom: var(--line); }
}

.project.future .project-art { order: 0; transform: rotate(1deg); }

.ach-team b { margin-right: .35em; }

.shot-cert { background: #fff; }
.shot-cert img { object-fit: contain; object-position: center; }

/* ---------- Achievements in one column with categories ---------- */
.achievements { grid-template-columns: minmax(0, 1fr); gap: 24px; }
.ach-cat { font-family: var(--font-head); font-weight: 900; font-size: 1.4rem; margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.ach-cat:first-child { margin-top: 0; }
.ach-cat span { font: 700 .8rem var(--font-head); background: var(--ink); color: var(--paper); border-radius: 999px; padding: 1px 10px; }
.ach-wide .gallery { flex: 0 0 48%; border-bottom: 0; border-right: var(--line); align-content: start; }
@media (max-width: 900px) {
  .ach-wide .gallery { flex-basis: auto; border-right: 0; border-bottom: var(--line); }
}

/* Alternate image side: odd cards image left, even cards image right */
@media (min-width: 901px) {
  .achievements > article.achievement:nth-of-type(even) { flex-direction: row-reverse; }
  .achievements > article.achievement:nth-of-type(even) .gallery,
  .achievements > article.achievement:nth-of-type(even) .cert { border-right: 0; border-left: var(--line); }
}

.cert-portrait .shot { width: auto; max-width: 100%; }
.cert-portrait .shot img { width: auto; max-width: 100%; max-height: 460px; margin: 0 auto; }
.ach-wide .cert.cert-portrait .shot { width: auto; justify-self: center; }

/* ---------- Sharper tone ---------- */
h1, h2, h3, h4 { letter-spacing: -0.01em; }
.hand-note { font-size: 1.15rem; }
.chapter { font-size: .95rem; letter-spacing: .04em; border-radius: 3px; }
.bubble { font-size: .9rem; border-radius: 10px; }
.bubble::after { display: none; }
.polaroid figcaption { font-size: .8rem; }
.project-no, .skill-proof, .detail-body h5 { font-size: .95rem; letter-spacing: .02em; }
.btn, .tab, .ach-badge { border-radius: 6px; }
.nav-links a, .chips li, .ach-cat span, .lightbox-close { border-radius: 6px; }
.panel, .pkg, .project details { border-radius: 8px; }
.art-icon { border-radius: 12px; }

/* Accent labels use the readable body font */
.hand-note, .polaroid figcaption, .bubble, .chapter, .project-no, .detail-body h5, .skill-proof, .site-footer { font-weight: 700; letter-spacing: 0; }
.hand-note { font-size: 1.1rem; }
.chapter { font-size: .9rem; letter-spacing: .03em; text-transform: uppercase; }
.skill-proof { font-size: .92rem; }
.project-no, .detail-body h5 { font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Motion ---------- */
.progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; z-index: 80; background: var(--accent); transform: scaleX(0); transform-origin: left; }

.facts .fact b { display: block; transition: transform .2s; }
.facts .fact:hover b { transform: scale(1.15) rotate(-3deg); }
.facts.animate-ready .fact { opacity: 0; transform: translateY(18px); }
.facts.in .fact { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
.facts.in .fact:nth-child(2) { transition-delay: .08s; }
.facts.in .fact:nth-child(3) { transition-delay: .16s; }
.facts.in .fact:nth-child(4) { transition-delay: .24s; }
.facts.in .fact:nth-child(5) { transition-delay: .32s; }
.facts.in .fact:nth-child(6) { transition-delay: .4s; }

.marquee { overflow: hidden; background: var(--sun); border-bottom: var(--line); padding: 10px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; flex: none; }
.marquee-group span { font: 800 .95rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; padding: 0 22px; white-space: nowrap; }
.marquee-group span::after { content: "◆"; margin-left: 44px; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

.hero h1 mark { background-repeat: no-repeat; background-size: 0% 100%; animation: sweep .7s ease-out forwards; }
.hero h1 mark:nth-of-type(1) { animation-delay: .3s; }
.hero h1 mark:nth-of-type(2) { animation-delay: .55s; }
.hero h1 mark:nth-of-type(3) { animation-delay: .8s; }
.hero h1 mark:nth-of-type(4) { animation-delay: 1.05s; }
@keyframes sweep { to { background-size: 100% 100%; } }

.skill, .edu-card, .achievement, .pkg, .aux { transition: transform .2s, box-shadow .2s; }
.skill:hover, .edu-card:hover, .achievement:hover, .aux:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.pkg:hover { transform: translateY(-3px); }

@media (max-width: 900px) { .facts-row { grid-template-columns: repeat(3, 1fr); row-gap: 22px; } }
@media (max-width: 480px) { .facts-row { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .hero h1 mark { animation: none; background-size: 100% 100%; }
  .facts.animate-ready .fact { opacity: 1; transform: none; }
  .skill, .edu-card, .achievement, .pkg, .aux { transition: none; }
}

/* ---------- Hero photo motion ---------- */
.portrait { transform: translate3d(calc(var(--px, 0) * 10px), calc(var(--py, 0) * 8px), 0); transition: transform .2s ease-out; }
.polaroid { transform: translate3d(calc(var(--px, 0) * 22px), calc(var(--py, 0) * 16px), 0); transition: transform .2s ease-out; }
.bubble { transform: translate3d(calc(var(--px, 0) * 16px), calc(var(--py, 0) * 12px), 0); transition: transform .2s ease-out; }

.portrait { animation: art-enter .8s cubic-bezier(.2, .9, .3, 1.2) backwards, art-float 6s 0.8s ease-in-out infinite; }
.polaroid { animation: art-enter .7s .35s cubic-bezier(.2, .9, .3, 1.4) backwards, art-sway 5s 1s ease-in-out infinite; transform-origin: top center; }
.bubble { animation: art-enter .6s .8s cubic-bezier(.2, .9, .3, 1.6) backwards, art-bob 3.2s 1.4s ease-in-out infinite; }

@keyframes art-enter { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }
@keyframes art-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes art-sway { 0%, 100% { rotate: -9deg; } 50% { rotate: -4deg; } }
@keyframes art-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

.glint {
  position: absolute; width: 14px; height: 14px; background: var(--sun); border: 2px solid var(--ink);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  pointer-events: none; opacity: 0; animation: glint 3.4s ease-in-out infinite;
  transform: translate3d(calc(var(--px, 0) * 30px), calc(var(--py, 0) * 24px), 0);
}
.glint:nth-of-type(1) { top: 6%; left: -6%; animation-delay: .2s; }
.glint:nth-of-type(2) { top: 30%; right: -9%; width: 18px; height: 18px; background: var(--accent); animation-delay: 1.1s; }
.glint:nth-of-type(3) { bottom: 38%; left: -10%; width: 10px; height: 10px; animation-delay: 2s; }
.glint:nth-of-type(4) { top: -3%; left: 38%; width: 10px; height: 10px; background: var(--accent); animation-delay: 1.6s; }
.glint:nth-of-type(5) { bottom: 4%; right: -5%; animation-delay: 2.6s; }
@keyframes glint { 0%, 100% { opacity: 0; scale: .3; rotate: 0deg; } 50% { opacity: 1; scale: 1; rotate: 90deg; } }

@media (prefers-reduced-motion: reduce) {
  .portrait, .polaroid, .bubble, .glint { animation: none; transition: none; transform: none; }
  .glint { opacity: .9; }
}
@media (max-width: 480px) { .glint { display: none; } }

/* ---------- Custom scrollbar ---------- */
::-webkit-scrollbar { width: 14px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); border-left: 2px solid var(--ink); }
::-webkit-scrollbar-thumb {
  background: var(--accent); border: 3px solid var(--ink); border-radius: 10px;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1.2px); background-size: 5px 5px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--sun); }
::-webkit-scrollbar-corner { background: var(--ink); }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: var(--accent) var(--ink); }
}
