/* ==========================================================================
   Tushar Sundesha — Cybersecurity Portfolio
   style.css
   Palette: near-black console + off-white / warm gray + restrained dev-green
   Type:    Space Grotesk (display) · IBM Plex Mono (chrome) · system (body)
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. Design tokens                                                           */
/* -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #0d0d0d;
  --bg-elev: #141414;
  --bg-elev-2: #1d1d1d;
  --term-bg: #111111;
  --nav-bg: rgba(13, 13, 13, 0.6);
  --nav-bg-scrolled: rgba(13, 13, 13, 0.9);

  /* Hairlines & borders */
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.3);

  /* Text */
  --text: #f2f2f2;
  --text-muted: #c2c2c2;
  --text-dim: #8f8f8f;

  /* Accent in monochrome */
  --accent: #ffffff;
  --accent-strong: #efefef;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --accent-line: rgba(255, 255, 255, 0.34);
  --grid-line: rgba(255, 255, 255, 0.06);
  --glow-a: rgba(255, 255, 255, 0.09);
  --glow-b: rgba(255, 255, 255, 0.05);
  --pulse-glow: rgba(255, 255, 255, 0.24);
  --premium: #d5c398;
  --premium-soft: rgba(213, 195, 152, 0.18);

  /* Feedback */
  --danger: #f0f0f0;
  --danger-soft: rgba(255, 255, 255, 0.12);

  /* Shape & rhythm */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --maxw: 1180px;
  --nav-h: 68px;

  /* Type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0d0d0d;
  --bg-elev: #141414;
  --bg-elev-2: #1d1d1d;
  --term-bg: #111111;
  --nav-bg: rgba(13, 13, 13, 0.6);
  --nav-bg-scrolled: rgba(13, 13, 13, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.3);
  --text: #f2f2f2;
  --text-muted: #c2c2c2;
  --text-dim: #8f8f8f;
  --accent: #ffffff;
  --accent-strong: #efefef;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --accent-line: rgba(255, 255, 255, 0.34);
  --grid-line: rgba(255, 255, 255, 0.06);
  --glow-a: rgba(255, 255, 255, 0.09);
  --glow-b: rgba(255, 255, 255, 0.05);
  --pulse-glow: rgba(255, 255, 255, 0.24);
  --premium: #d5c398;
  --premium-soft: rgba(213, 195, 152, 0.18);
  --danger: #f0f0f0;
  --danger-soft: rgba(255, 255, 255, 0.12);
}

/* -------------------------------------------------------------------------- */
/* 2. Reset & base                                                            */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

strong {
  color: var(--text);
  font-weight: 600;
}

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

/* Focus states — visible for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 12px;
}

/* -------------------------------------------------------------------------- */
/* 3. Layout helpers                                                          */
/* -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2rem);
}

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
  position: relative;
}

.section__head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__title {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  color: var(--text);
}

/* Terminal-style section eyebrow (encodes the section as a shell command) */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
}
.eyebrow__path {
  color: var(--accent);
}

.accent-text {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

/* Visually-hidden but readable by screen readers (real name for a11y/SEO) */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------- */
/* 4. Ambient background (CSS only — grid + soft glow)                        */
/* -------------------------------------------------------------------------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 78% 8%, var(--glow-a), transparent 70%),
    radial-gradient(50% 40% at 12% 4%, var(--glow-b), transparent 70%);
}

.bg-cubes {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Rubik cube palette — monochrome */
:root {
  --rk-sticker: #35353c;
  --rk-gap: #050506;
  --rk-edge: rgba(0, 0, 0, 0.8);
}

/* Floating wrapper: places the cube and gives it a gentle vertical drift */
.rubik {
  position: absolute;
  width: var(--rk, 240px);
  height: var(--rk, 240px);
  perspective: 1200px;
  will-change: transform;
  animation: rubikFloat 16s ease-in-out infinite;
}

/* Inner box: the spinning 3D cube */
.rubik__box {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-30deg);
  animation: rubikSpin 48s linear infinite;
  will-change: transform;
}

/* Each face is a 3x3 grid of "stickers" drawn purely with gradients —
   nine solid rectangles over a dark "gap" background, no child nodes. */
.rubik__face {
  position: absolute;
  inset: 0;
  background-color: var(--rk-gap);
  background-image:
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker)),
    linear-gradient(var(--rk-sticker), var(--rk-sticker));
  background-repeat: no-repeat;
  background-size: 28% 28%;
  background-position:
    6% 6%, 50% 6%, 94% 6%,
    6% 50%, 50% 50%, 94% 50%,
    6% 94%, 50% 94%, 94% 94%;
  border: 2px solid var(--rk-edge);
  border-radius: 10px;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.55);
  backface-visibility: hidden;
}

/* Per-face lighting tint (overlay, so we avoid filter + 3D quirks) */
.rubik__face::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--rk-shade, transparent);
}
.rubik__face--top { --rk-shade: rgba(255, 255, 255, 0.16); }
.rubik__face--front { --rk-shade: transparent; }
.rubik__face--back { --rk-shade: rgba(0, 0, 0, 0.26); }
.rubik__face--right { --rk-shade: rgba(0, 0, 0, 0.3); }
.rubik__face--left { --rk-shade: rgba(0, 0, 0, 0.44); }
.rubik__face--bottom { --rk-shade: rgba(0, 0, 0, 0.52); }

/* Assemble the six faces into a cube (translateZ = half the cube size) */
.rubik__face--front { transform: translateZ(calc(var(--rk, 240px) / 2)); }
.rubik__face--back { transform: rotateY(180deg) translateZ(calc(var(--rk, 240px) / 2)); }
.rubik__face--right { transform: rotateY(90deg) translateZ(calc(var(--rk, 240px) / 2)); }
.rubik__face--left { transform: rotateY(-90deg) translateZ(calc(var(--rk, 240px) / 2)); }
.rubik__face--top { transform: rotateX(90deg) translateZ(calc(var(--rk, 240px) / 2)); }
.rubik__face--bottom { transform: rotateX(-90deg) translateZ(calc(var(--rk, 240px) / 2)); }

/* Cube placement + individual motion tuning */
.rubik--a {
  --rk: 258px;
  top: 13%;
  right: 6%;
  opacity: 0.42;
  animation-duration: 15s;
}
.rubik--a .rubik__box {
  animation-duration: 44s;
}
.rubik--b {
  --rk: 168px;
  bottom: 12%;
  left: 5%;
  opacity: 0.3;
  animation-duration: 19s;
  animation-delay: -6s;
}
.rubik--b .rubik__box {
  animation-duration: 64s;
  animation-direction: reverse;
}

@keyframes rubikFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-24px); }
}
@keyframes rubikSpin {
  0% { transform: rotateX(-22deg) rotateY(0deg) rotateZ(0deg); }
  50% { transform: rotateX(16deg) rotateY(180deg) rotateZ(5deg); }
  100% { transform: rotateX(-22deg) rotateY(360deg) rotateZ(0deg); }
}

/* -------------------------------------------------------------------------- */
/* 5. Buttons                                                                 */
/* -------------------------------------------------------------------------- */
.btn {
  --btn-py: 0.8rem;
  --btn-px: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5ch;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: var(--btn-py) var(--btn-px);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  will-change: transform;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 0 0 transparent;
}
.btn--primary:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -12px var(--accent-line);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  transform: translateY(-2px);
  background: var(--accent-soft);
}

.btn--link {
  padding-left: 0;
  padding-right: 0;
  color: var(--text-muted);
  border-radius: 4px;
}
.btn--link:hover {
  color: var(--accent);
}

.btn--sm {
  --btn-py: 0.55rem;
  --btn-px: 1rem;
  font-size: 0.8rem;
}

.btn--block {
  width: 100%;
}

.btn[aria-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

/* -------------------------------------------------------------------------- */
/* 6. Navbar                                                                  */
/* -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.scrolled {
  background: var(--nav-bg-scrolled);
  border-bottom-color: var(--line);
}

.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.nav__logo-dot {
  color: var(--accent);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav__link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__link:hover {
  color: var(--text);
}
.nav__link.active {
  color: var(--accent);
}
/* underline indicator for the active link */
.nav__link.active::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.2rem;
  height: 1.5px;
  background: var(--accent);
  border-radius: 2px;
}

.nav__link--cta {
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.nav__link--cta:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}
.nav__link--cta.active::after {
  display: none;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Hamburger toggle (hidden on desktop) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
}
.nav__toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

/* -------------------------------------------------------------------------- */
/* 7. Hero                                                                    */
/* -------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}

.hero__content {
  position: relative;
  padding: clamp(0.25rem, 1vw, 0.6rem) 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.terminal-label {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--accent);
  margin-bottom: 1.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.terminal-label__prompt {
  margin-right: 0.5ch;
  opacity: 0.8;
}
.terminal-label__dots::after {
  content: "";
}

.hero__title {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.hero__greet {
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}

/* Typewriter name */
.typer {
  display: inline-flex;
  align-items: center;
  font-size: clamp(1.55rem, 6.4vw, 3.1rem);
  line-height: 1.04;
  color: var(--text);
  min-height: 1.08em; /* reserve height so nothing jumps while typing */
  white-space: nowrap;
}
.typer__caret {
  display: inline-block;
  width: 0.6ch;
  height: 1.02em;
  margin-left: 0.1em;
  background: var(--accent);
  animation: caretBlink 1.05s step-end infinite;
}
@keyframes caretBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.hero__desc {
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  max-width: 46ch;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.hero__visual {
  width: 100%;
}

.flapboard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%), var(--bg-elev);
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  padding: clamp(1.1rem, 3vw, 1.7rem);
  box-shadow:
    0 18px 40px -26px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 var(--line);
}

.flapboard__row {
  display: flex;
  justify-content: center;
  gap: clamp(0.3rem, 1.3vw, 0.55rem);
  perspective: 700px;
}

/* One split-flap tile — dark "physical" display in both themes */
.flap {
  --flap-h: clamp(2.7rem, 11vw, 4.4rem);
  position: relative;
  flex: 1 1 0;
  max-width: 3.6rem;
  height: var(--flap-h);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.1rem, 4.4vw, 2rem);
  color: #101010;
  background: linear-gradient(180deg, #f8f4ea 0 49.6%, #e7e0d1 50.4% 100%);
  border: 1px solid #a79f90;
  border-radius: 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 0 0 1px rgba(0, 0, 0, 0.16),
    0 3px 6px -2px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.52);
  transform-style: preserve-3d;
}

/* horizontal seam across the middle of each tile */
.flap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.28);
  z-index: 2;
  pointer-events: none;
}

.flap.is-flipping {
  animation: flapFlip 0.16s var(--ease);
}
@keyframes flapFlip {
  0% { transform: rotateX(0deg); }
  45% { transform: rotateX(-24deg); filter: brightness(1.18); }
  100% { transform: rotateX(0deg); }
}

.flapboard__caption {
  margin-top: 0.85rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}

.flapboard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 34%), var(--bg-elev-2);
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
}
.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--pulse-glow);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--pulse-glow); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* -------------------------------------------------------------------------- */
/* 9. About                                                                   */
/* -------------------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about__text p {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  max-width: 62ch;
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.6rem;
}
.about__tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
}

/* Stats */
.stats {
  display: grid;
  gap: 1rem;
}
.stat {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  background: var(--bg-elev);
}
.stat__value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* -------------------------------------------------------------------------- */
/* 10. Skills                                                                 */
/* -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.skill-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 1.8rem);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  background: var(--bg-elev-2);
}

.skill-card__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.skill-card__no {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}
.skill-card__title {
  font-size: 1.2rem;
  color: var(--text);
}

/* Chips (skill / tech tags) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.skill-card:hover .chips li {
  border-color: var(--line-strong);
}
.chips--sm li {
  font-size: 0.74rem;
  padding: 0.32rem 0.6rem;
}

/* -------------------------------------------------------------------------- */
/* 11. Journey timeline                                                       */
/* -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 2rem;
  display: grid;
  gap: 1rem;
}
/* the vertical rail */
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent-line),
    var(--line) 55%,
    var(--line)
  );
}

.tl-item {
  position: relative;
}
.tl-node {
  position: absolute;
  left: calc(-2rem + 1px);
  top: 1.15rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  z-index: 1;
}

.tl-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.25rem;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.tl-item:hover .tl-card {
  transform: translateX(4px);
  border-color: var(--line-strong);
}
.tl-title {
  font-size: 1.02rem;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--text);
}
.tl-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--text-dim);
  order: 2;
}

/* status variants */
.tl-item--done .tl-node {
  background: var(--accent);
  border-color: var(--accent);
}
.tl-item--done .tl-status {
  color: var(--accent);
  border-color: var(--accent-line);
}

.tl-item--active .tl-node {
  background: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 0 var(--pulse-glow);
  animation: pulse 2.6s var(--ease) infinite;
}
.tl-item--active .tl-card {
  border-color: var(--accent-line);
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%), var(--bg-elev);
}
.tl-item--active .tl-status {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.tl-item--next .tl-node {
  background: var(--bg);
  border-style: dashed;
  border-color: var(--text-dim);
}

/* -------------------------------------------------------------------------- */
/* 12. Projects                                                               */
/* -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 1.9rem);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-line);
  background: var(--bg-elev-2);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.9);
}

.project-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.project-card__no {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.project-card__glyph {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.3s var(--ease);
}
.project-card:hover .project-card__glyph {
  color: var(--accent);
}

.project-card__title {
  font-size: 1.28rem;
  color: var(--text);
  margin-bottom: 0.7rem;
}
.project-card__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}
.project-card .chips {
  margin-bottom: 1.5rem;
}
.project-card__actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* -------------------------------------------------------------------------- */
/* 13. Certifications                                                         */
/* -------------------------------------------------------------------------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.cert-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  min-height: 190px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  background: var(--bg-elev-2);
}
.cert-card__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.cert-card:hover .cert-card__tag {
  color: var(--accent);
  border-color: var(--accent-line);
}
.cert-card__title {
  font-size: 1.1rem;
  color: var(--text);
  margin-top: auto;
}

/* -------------------------------------------------------------------------- */
/* 14. Contact                                                                */
/* -------------------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact__desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 38ch;
}

.socials {
  display: grid;
  gap: 0.75rem;
}
.social {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
    background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.social:hover {
  border-color: var(--accent-line);
  transform: translateX(4px);
  background: var(--bg-elev-2);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.75);
}

.social__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: var(--text);
}

.social__icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.social__copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}
.social__key {
  color: var(--text);
  font-size: 0.8rem;
}
.social__val {
  color: var(--text-dim);
  font-size: 0.77rem;
  overflow-wrap: anywhere;
}
.social:hover .social__val {
  color: var(--accent);
}

.social__arrow {
  color: var(--text-dim);
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.social:hover .social__arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* Form */
.form {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3.5vw, 2.2rem);
}
.field {
  margin-bottom: 1.25rem;
}
.field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.field__input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}
.field__input::placeholder {
  color: var(--text-dim);
}
.field__input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-elev);
}
.field__textarea {
  resize: vertical;
  min-height: 130px;
}

/* invalid state */
.field__input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field__error {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--danger);
  min-height: 1em;
  margin-top: 0.4rem;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.field__error.show {
  opacity: 1;
  transform: none;
}

.field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.field__count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s var(--ease);
}
.field__count--max {
  color: var(--accent);
}

/* success message */
.form__success {
  display: flex;
  align-items: center;
  gap: 0.7ch;
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}
.form__success[hidden] {
  display: none;
}
.form__success.show {
  animation: successPop 0.5s var(--ease);
}
.form__success-check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
}
@keyframes successPop {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  60% { transform: translateY(0) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------- */
/* 15. Footer                                                                 */
/* -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(2rem, 4vw, 2.75rem) 0;
  background: var(--bg-elev);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer__copy {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--text);
}
.footer__built {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.footer__top {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.footer__top:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

/* -------------------------------------------------------------------------- */
/* 16. Scroll-reveal animation                                                */
/* -------------------------------------------------------------------------- */
/* Hidden state only applies when JS is available (html.js), so the page
   stays fully visible if JavaScript is disabled. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
/* subtle stagger inside grids/timelines */
.skills-grid [data-reveal]:nth-child(2),
.projects-grid [data-reveal]:nth-child(2),
.cert-grid [data-reveal]:nth-child(2),
.timeline [data-reveal]:nth-child(2) { transition-delay: 0.07s; }
.skills-grid [data-reveal]:nth-child(3),
.projects-grid [data-reveal]:nth-child(3),
.cert-grid [data-reveal]:nth-child(3),
.timeline [data-reveal]:nth-child(3) { transition-delay: 0.14s; }
.skills-grid [data-reveal]:nth-child(4),
.projects-grid [data-reveal]:nth-child(4),
.cert-grid [data-reveal]:nth-child(4),
.timeline [data-reveal]:nth-child(4) { transition-delay: 0.21s; }
.timeline [data-reveal]:nth-child(n + 5) { transition-delay: 0.24s; }

/* ==========================================================================
   17. Responsive
   Targets: 1920 / 1440 / 1024 / 768 / 480 / 375 / 320
   ========================================================================== */

/* Large desktop — widen container a touch */
@media (min-width: 1440px) {
  :root { --maxw: 1240px; }
}

/* Tablet / small laptop */
@media (max-width: 1024px) {
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Nav collapse + hero stack */
@media (max-width: 860px) {
  .nav__toggle {
    display: flex;
  }

  /* mobile menu panel */
  .nav__menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--nav-bg-scrolled);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem clamp(1.1rem, 4vw, 2rem) 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease),
      visibility 0.28s var(--ease);
  }
  .nav.is-open .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .nav__actions {
    gap: 0.45rem;
  }
  .nav__link {
    display: block;
    padding: 0.8rem 0.6rem;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav__link.active::after {
    display: none;
  }
  .nav__link--cta {
    margin-top: 0.6rem;
    text-align: center;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--line-strong);
  }

  /* hamburger → X */
  .nav.is-open .nav__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav.is-open .nav__toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .nav.is-open .nav__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* hero stacks, terminal below content */
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero__desc {
    max-width: none;
  }

  /* about + contact single column */
  .about,
  .contact {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Phones — everything single column */
@media (max-width: 620px) {
  .skills-grid,
  .projects-grid,
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .tl-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .tl-status {
    order: 0;
  }
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .flapboard__row {
    gap: 0.28rem;
  }

  /* keep the ambient cubes subtle and uncluttered on small screens */
  .rubik--b {
    display: none;
  }
  .rubik--a {
    --rk: 188px;
    opacity: 0.3;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .btn {
    width: 100%;
  }
}

/* Very small phones (320px) */
@media (max-width: 360px) {
  .container {
    padding: 0 0.9rem;
  }
  .social {
    grid-template-columns: auto 1fr;
    gap: 0.6rem 0.7rem;
    padding: 0.85rem 0.9rem;
  }
  .social__arrow {
    display: none;
  }
}

/* -------------------------------------------------------------------------- */
/* 18. Reduced motion                                                         */
/* -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .rubik,
  .rubik__box {
    animation: none !important;
  }
  .rubik__box {
    transform: rotateX(-24deg) rotateY(-32deg);
  }
  .flap.is-flipping {
    animation: none !important;
  }
  .typer__caret {
    animation: none !important;
    opacity: 1;
  }
}
