/* Arun Sapkota portfolio. Tokens first, then layout. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(../assets/fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(../assets/fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(../assets/fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(../assets/fonts/public-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 500; font-display: swap; src: url(../assets/fonts/public-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url(../assets/fonts/public-sans-latin-600-normal.woff2) format("woff2"); }

:root {
  --bg: #e8ebed; --surface: #f6f7f8; --ink: #14222e; --muted: #526069; --rule: #c6cdd2; --rule-strong: #9aa7b0;
  --accent: #e8590c; --accent-ink: #b8430a; --steel: #1f4e6b; --hero-bg: #dfe4e7;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bar-h: 64px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10181e; --surface: #172229; --ink: #e6ecef; --muted: #9aa8b1; --rule: #28363f; --rule-strong: #475a66;
    --accent: #ff8a3d; --accent-ink: #ff9d5c; --steel: #7fb4d6; --hero-bg: #0c1317; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10181e; --surface: #172229; --ink: #e6ecef; --muted: #9aa8b1; --rule: #28363f; --rule-strong: #475a66;
  --accent: #ff8a3d; --accent-ink: #ff9d5c; --steel: #7fb4d6; --hero-bg: #0c1317; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1.02rem; line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1rem; max-width: 62ch; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: .005em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 100; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* road centre-line: the one motif */
.cl { display: block; height: 4px; background: repeating-linear-gradient(90deg, var(--accent) 0 26px, transparent 26px 42px); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.bar { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); height: var(--bar-h); display: flex; align-items: center; gap: 1.4rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; text-transform: uppercase; }
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.tabs { display: flex; gap: .2rem; margin-left: auto; }
.tabs a { position: relative; display: block; padding: .5rem .8rem; text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); }
.tabs a.is-active::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: -13px; height: 3px; background: var(--accent); }
.bar-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); border-radius: 8px; cursor: pointer; font: inherit; }
.icon-btn:hover { background: var(--surface); }
.menu-btn { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .62rem 1.1rem; border: 1.5px solid var(--ink); border-radius: 8px; background: transparent; color: var(--ink); font: 600 .94rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--surface); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--steel); border-color: var(--steel); color: #fff; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #14100c; }
.btn--accent:hover { filter: brightness(1.08); background: var(--accent); }
.btn--sm { padding: .45rem .9rem; font-size: .86rem; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--accent); }

/* hero */
.hero { background: var(--hero-bg); border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero-in { max-width: 1240px; margin: 0 auto; padding: clamp(2.4rem, 5vw, 4.5rem) clamp(1rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; min-height: min(680px, calc(100vh - var(--bar-h))); }
.hero h1 { font-size: clamp(4.6rem, 13vw, 9.6rem); font-weight: 800; line-height: .86; text-transform: uppercase; letter-spacing: -.005em; }
.hero h1 span { display: block; }
.hero h1 .first { color: var(--ink); }
.hero h1 .last { color: var(--steel); }
.hero .cl { width: min(100%, 360px); margin: 1.4rem 0 1.4rem; }
.role { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.1; margin: 0 0 .5rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 34rem; margin: 0 0 1.6rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-meta { margin: 1.6rem 0 0; font-size: .9rem; color: var(--muted); }
.hero-photo { position: relative; justify-self: center; width: min(100%, 410px); aspect-ratio: 4 / 5; }
.hero-photo::before { content: ""; position: absolute; inset: 22px -22px -22px 22px; background: var(--accent); }
.hero-photo img { position: relative; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border: 1px solid var(--rule-strong); }

/* page + sections: label column on the left, content on the right */
.page { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem) 3rem; }
.page > section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2rem 3rem; padding: 4.2rem 0; border-bottom: 1px solid var(--rule); }
.page > section > h2 { font-size: clamp(2.1rem, 3.4vw, 2.8rem); text-transform: uppercase; position: sticky; top: calc(var(--bar-h) + 24px); align-self: start; }
.page > section > h2::after { content: ""; display: block; width: 56px; height: 4px; margin-top: .7rem; background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 22px); }
.sec-body { min-width: 0; }
.lead { font-size: 1.3rem; line-height: 1.5; max-width: 40ch; }
h3 { font-size: 1.5rem; }

/* timeline entries (education, experience) */
.entry { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .4rem 1.6rem; padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.entry:first-child { border-top: 0; padding-top: 0; }
.when { font-size: .88rem; font-weight: 500; color: var(--muted); padding-top: .35rem; }
.entry h3 { margin-bottom: .15rem; }
.where { color: var(--muted); margin: 0 0 .7rem; }
.entry ul.pts { margin: 0 0 .8rem; padding-left: 1.1rem; }
.entry ul.pts li { margin-bottom: .35rem; max-width: 62ch; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: .4rem 0 0; padding: 0; }
.chips li { font-size: .82rem; font-weight: 500; padding: .2rem .65rem; border: 1px solid var(--rule-strong); border-radius: 99px; background: var(--surface); }
.uni { display: flex; gap: 1.1rem; align-items: flex-start; }
.uni > div { min-width: 0; }
.uni-logo { flex: none; width: 112px; height: 64px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px 10px; background: #fff; border: 1px solid var(--rule-strong); }
.uni-logo img { width: auto; height: auto; max-width: 100%; max-height: 46px; }
.note { margin-top: 1.4rem; padding: 1rem 1.2rem; border-left: 4px solid var(--accent); background: var(--surface); }
.note strong { display: block; font-family: var(--display); font-size: 1.2rem; letter-spacing: .01em; margin-bottom: .2rem; }
.note p { margin: 0; }

/* projects */
.project { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .3rem 1.6rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.project:first-of-type { border-top: 0; padding-top: 0; }
.project h3 { margin-bottom: .3rem; }
.project p { margin-bottom: .6rem; }
.std { font-size: .86rem; color: var(--muted); margin: 0; }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1.1rem; }
.figs--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figs--one { grid-template-columns: minmax(0, 300px); }
.figs figure { margin: 0; }
.fig { display: block; aspect-ratio: 4 / 3; background: #fff; border: 1px solid var(--rule-strong); overflow: hidden; cursor: zoom-in; }
.fig img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s; }
.fig:hover img { transform: scale(1.04); }
.figs figcaption { margin-top: .35rem; font-size: .82rem; line-height: 1.4; color: var(--muted); max-width: 34ch; }
.lightbox { border: 0; padding: 0; background: #fff; color: #14222e; max-width: min(94vw, 1200px); max-height: 92vh; overflow: auto; }
.lightbox::backdrop { background: rgba(10, 16, 20, .82); }
.lightbox img { max-width: 100%; max-height: 78vh; width: auto; height: auto; margin: 0 auto; }
.lightbox p { margin: 0; padding: .7rem 1.2rem 1rem; font-size: .92rem; max-width: none; border-top: 1px solid #c6cdd2; }
.lb-close { position: absolute; top: .5rem; right: .5rem; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #14222e; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* skills */
.skills { margin: 0; border-top: 1px solid var(--rule); }
.skills div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--rule); }
.skills dt { font-weight: 600; font-size: .94rem; }
.skills dd { margin: 0; }
.lead-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.lead-list li { padding: .5rem 0 .5rem 1rem; border-left: 3px solid var(--accent); margin-bottom: .5rem; }
.sub { font-size: 1.5rem; margin: 2.2rem 0 .8rem; text-transform: uppercase; }

/* contact */
.closing { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 2.4rem; align-items: center; }
.closing-photo { margin: 0; }
.closing-photo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--rule-strong); box-shadow: 14px 14px 0 var(--accent); }
.contact-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 1rem; }
.mail-line { font-weight: 500; color: var(--muted); margin: 0; }

.site-footer { max-width: 1240px; margin: 0 auto; padding: 1.6rem clamp(1rem, 3vw, 2rem) 2.4rem; display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: .6rem 1.1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: .25s; font-size: .9rem; z-index: 90; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.js .hero-in > div > * { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.js .hero-in > div > :nth-child(2) { animation-delay: .06s; } .js .hero-in > div > :nth-child(3) { animation-delay: .12s; } .js .hero-in > div > :nth-child(4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 1080px) { .tabs a { padding: .5rem .55rem; font-size: .88rem; } .tabs a.is-active::after { left: .55rem; right: .55rem; } }
@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .tabs { display: none; position: absolute; left: 0; right: 0; top: var(--bar-h); flex-direction: column; margin: 0; padding: .5rem clamp(1rem, 3vw, 2rem) 1rem; background: var(--bg); border-bottom: 1px solid var(--rule); }
  .topbar.open .tabs { display: flex; }
  .tabs a { padding: .8rem 0; border-bottom: 1px solid var(--rule); font-size: 1rem; }
  .tabs a.is-active::after { display: none; }
  .bar-actions { margin-left: auto; }
  .hero-in { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { width: min(78%, 340px); justify-self: start; }
  .page > section { grid-template-columns: 1fr; padding: 3rem 0; }
  .page > section > h2 { position: static; }
}
@media (max-width: 640px) {
  .entry, .project { grid-template-columns: 1fr; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uni-logo { width: 88px; height: 56px; }
  .uni-logo img { max-height: 38px; }
  .figs--one { grid-template-columns: minmax(0, 1fr); }
  .skills div { grid-template-columns: 1fr; gap: .2rem; }
  .closing { grid-template-columns: 1fr; }
  .closing-photo { max-width: 230px; }
  .brand span { font-size: 1.15rem; }
  .btn.cv-top { display: none; }
  .site-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .topbar, .toast, .lightbox, .hero-photo::before { display: none !important; } .page > section > h2 { position: static; } }
