/* kiranc.me: static, zero-JS, zero external requests.
   Palette: deep blue-black + phosphor amber (VT220 heritage, no hacker cliché).
   Type: Geist + Geist Mono (SIL OFL), self-hosted variable fonts. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0f14;
  --bg-raise: #10161e;
  --line: #1d2734;
  --text: #e8ecf1;
  --text-mute: #9aa5b1;
  --accent: #d9a441;
  --accent-soft: #b08a3e;
  --accent-dim: #8a6a2f;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* links inside prose need a resting underline; color alone fails WCAG 1.4.1 */
main p a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-dim); }
main p a:hover { text-decoration-color: var(--accent); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.92);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.brand {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }

.topbar nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.8rem;
}
.topbar nav a { color: var(--text-mute); }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }
.topbar nav a.nav-hot { color: var(--accent); }
.topbar nav a.nav-hot:hover { color: #e3b356; }

/* ---------- hero ---------- */

.hero { padding: 5.5rem 0 4rem; }

.hero-split {
  display: flex;
  align-items: center;
  gap: 2.8rem;
}

.hero-text { flex: 1 1 auto; min-width: 0; }

.portrait {
  flex: none;
  position: relative;
  color: var(--accent);
  font-size: 0.42rem;
  line-height: 1.2;
  user-select: none;
  -webkit-mask-image: linear-gradient(180deg, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 84%, transparent 100%);
}

.portrait pre {
  animation: glyph-cycle 1.5s linear infinite;
  opacity: 0;
}

.portrait pre + pre {
  position: absolute;
  top: 0;
  left: 0;
}

.portrait pre:nth-child(2) { animation-delay: 0.5s; }
.portrait pre:nth-child(3) { animation-delay: 1s; }
.portrait pre:nth-child(4) { animation-delay: 0.1s; }
.portrait pre:nth-child(5) { animation-delay: 0.6s; }
.portrait pre:nth-child(6) { animation-delay: 1.1s; }
.portrait pre:nth-child(7) { animation-delay: 0.2s; }
.portrait pre:nth-child(8) { animation-delay: 0.7s; }
.portrait pre:nth-child(9) { animation-delay: 1.2s; }
.portrait pre:nth-child(10) { animation-delay: 0.3s; }
.portrait pre:nth-child(11) { animation-delay: 0.8s; }
.portrait pre:nth-child(12) { animation-delay: 1.3s; }
.portrait pre:nth-child(13) { animation-delay: 0.4s; }
.portrait pre:nth-child(14) { animation-delay: 0.9s; }
.portrait pre:nth-child(15) { animation-delay: 1.4s; }

@keyframes glyph-cycle {
  0% { opacity: 0; }
  4% { opacity: 1; }
  33.33% { opacity: 1; }
  37.33% { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .portrait pre { animation: none; }
  .portrait pre:nth-child(3n+1) { opacity: 1; }
}

/* the portrait needs elbow room: hide it under 64rem, break the hero
   out wider than the body column above it */
@media (max-width: 63.99rem) {
  .portrait { display: none; }
}
@media (min-width: 64rem) {
  .hero-split { margin-inline: -7.5rem; gap: 3.5rem; }
}

.prompt {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 1.4rem;
}
.prompt-user { color: var(--accent); }
.prompt-path { color: var(--text); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.35em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.type-cmd {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: 6ch;
  animation: type-cmd 0.85s steps(6, end) 0.35s both;
}
@keyframes type-cmd { from { width: 0; } }
@media (prefers-reduced-motion: reduce) {
  .type-cmd { animation: none; width: 6ch; }
}

/* section commands type themselves as they scroll into view;
   browsers without scroll timelines just show the full text */
.tw {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}
.tw12 { width: 12ch; }
.tw14 { width: 14ch; }
.tw16 { width: 16ch; }
.tw18 { width: 18ch; }
@supports (animation-timeline: view()) {
  .tw {
    animation-name: tw-type;
    animation-duration: 1ms;
    animation-fill-mode: both;
    animation-timeline: view();
    animation-range: entry 0% cover 32%;
  }
  .tw12 { animation-timing-function: steps(12, end); }
  .tw14 { animation-timing-function: steps(14, end); }
  .tw16 { animation-timing-function: steps(16, end); }
  .tw18 { animation-timing-function: steps(18, end); }
}
@keyframes tw-type { from { width: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tw { animation: none; }
}

h1 {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.role {
  margin-top: 0.6rem;
  font-size: 1.15rem;
  color: var(--text);
}
.role .at { color: var(--accent); font-family: var(--mono); }

.lede {
  margin-top: 1.4rem;
  color: var(--text-mute);
  max-width: 38rem;
}

.hero-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 1.6rem;
  font-size: 0.8rem;
  color: var(--text-mute);
}
.hero-meta li::before { content: "▸ "; color: var(--accent-dim); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.2rem;
}

.btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--bg-raise);
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.btn:hover { border-color: var(--accent-dim); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover { background: #e3b356; border-color: #e3b356; }

/* ---------- security page ---------- */

.hero-compact { padding: 4rem 0 1.5rem; }

.sec-note { color: var(--text-mute); max-width: 40rem; margin-bottom: 1rem; }

.sec-list {
  list-style: none;
  color: var(--text-mute);
  max-width: 42rem;
}
.sec-list li {
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.7rem;
}
.sec-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}
.sec-list strong { color: var(--text); font-weight: 600; }

.sec-headers {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raise);
  padding: 1.1rem 1.2rem;
  max-width: 42rem;
}
.sec-headers dt {
  color: var(--accent);
  font-size: 0.8rem;
  margin-top: 0.9rem;
}
.sec-headers dt:first-child { margin-top: 0; }
.sec-headers dd {
  color: var(--text-mute);
  font-size: 0.78rem;
  line-height: 1.6;
  margin-top: 0.2rem;
}

.code-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raise);
  padding: 0.9rem 1.1rem;
  font-size: 0.8rem;
  color: var(--text);
  overflow-x: auto;
  max-width: 42rem;
}

.flag {
  color: var(--accent);
  font-size: 1rem;
  margin: 1.6rem 0;
  user-select: all;
}

/* ---------- sections ---------- */

section { padding: 2.6rem 0; scroll-margin-top: 4.5rem; }

h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 1.8rem;
}

.cmd-head { font-weight: 500; letter-spacing: 0; }

/* ---------- experience ---------- */

.job {
  position: relative;
  padding-left: 1.6rem;
  border-left: 1px solid var(--line);
  margin-bottom: 2.4rem;
}
.job:last-child { margin-bottom: 0; }

.job::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.5em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-dim);
}
.job:first-of-type::before { border-color: var(--accent); }

.job-head h3 { font-size: 1.1rem; font-weight: 650; }

.job-org { color: var(--text-mute); margin-top: 0.15rem; }
.job-org .sep { color: var(--accent-dim); }

.job-dates {
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 0.2rem;
  letter-spacing: 0.03em;
}

.job ul {
  list-style: none;
  margin-top: 0.9rem;
  color: var(--text-mute);
  font-size: 0.98rem;
}
.job li { padding-left: 1.1rem; position: relative; margin-bottom: 0.55rem; }
.job li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}
.job li strong { color: var(--text); font-weight: 600; }

/* ---------- certifications ---------- */

.certs-note {
  color: var(--text-mute);
  font-size: 0.9rem;
  margin: -0.9rem 0 1.4rem;
}

.certs {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.cert {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raise);
  padding: 1rem 1.1rem;
  transition: border-color 120ms ease;
}
.cert:hover { border-color: var(--accent-dim); }

.cert-badge {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 4px;
}

.cert-body { min-width: 0; }

.cert-name { font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.cert-abbr {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
}
.cert-meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-mute);
}
.cert-verify {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.75rem;
}
.cert-verify + .cert-verify { margin-left: 0.9rem; }

/* ---------- skills ---------- */

.skill-row {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.skill-label {
  flex: 0 0 6.5rem;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips li {
  font-size: 0.78rem;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

/* ---------- contact / footer ---------- */

.term-output {
  color: var(--text-mute);
  max-width: 40rem;
  font-size: 0.9rem;
  line-height: 1.85;
}
.term-output p { margin: 0; }
.term-exit {
  color: var(--accent-dim);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.4rem;
  padding-bottom: 2rem;
  font-size: 0.75rem;
  color: var(--text-mute);
}
.trust { color: var(--accent-soft); }
.trust a { color: inherit; }
.trust a:hover { color: var(--accent); text-decoration: none; }

/* ---------- small screens ---------- */

@media (max-width: 40rem) {
  .certs { grid-template-columns: 1fr; }
  .skill-row { flex-direction: column; gap: 0.4rem; }
  .skill-label { flex: none; }
  .topbar { position: static; }
  .topbar-inner { flex-wrap: wrap; row-gap: 0.1rem; }
  .topbar nav { gap: 0.25rem 0.9rem; font-size: 0.75rem; flex-wrap: wrap; }
  .hero { padding-top: 3.5rem; }
  section { scroll-margin-top: 1rem; }
}

/* ---------- print ---------- */

@media print {
  :root {
    --bg: #ffffff;
    --bg-raise: #ffffff;
    --line: #c8ccd2;
    --text: #14181d;
    --text-mute: #43505c;
    --accent: #8a5f1d;
    --accent-soft: #8a5f1d;
    --accent-dim: #8a5f1d;
  }
  body { background: #ffffff; }
  .topbar, .cursor, .hero-actions { display: none; }
  .job, .cert { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
