/* ==========================================================================
   NIK ARSYAD BIN ABDUL GHANI — DIGITAL PORTFOLIO DESIGN SYSTEM
   Theme: Warm Editorial Linen & Parchment (Light Default + Espresso Dark)
   ========================================================================== */

:root,
[data-theme="light"] {
  /* Core Palette */
  --parchment: #edede9;
  --dust-grey: #d6ccc2;
  --linen: #f5ebe0;
  --powder-petal: #e3d5ca;
  --almond-silk: #d5bdaf;

  /* Light Mode Surfaces & Ink */
  --bg-primary: var(--parchment);
  --bg-secondary: var(--linen);
  --bg-card: rgba(245, 235, 224, 0.92);
  --bg-card-solid: var(--linen);
  --bg-elevated: var(--powder-petal);
  --bg-glass: rgba(237, 237, 233, 0.9);

  --text-primary: #2d2622;
  --text-secondary: #534840;
  --text-muted: #7a6d64;

  --accent-primary: #8a5a44;
  --accent-primary-hover: #6e4532;
  --accent-secondary: #5d6f5b;
  --accent-amber: #96663d;
  --accent-rose: #965753;
  --accent-violet: #6f5f6d;

  --accent-glow: rgba(213, 189, 175, 0.28);
  --accent-soft: var(--powder-petal);
  --emerald-soft: rgba(93, 111, 91, 0.14);

  --border-subtle: var(--dust-grey);
  --border-strong: var(--almond-silk);

  --shadow-sm: 0 2px 8px rgba(45, 38, 34, 0.05);
  --shadow-md: 0 8px 22px rgba(45, 38, 34, 0.08);
  --shadow-lg: 0 16px 36px rgba(45, 38, 34, 0.11);
  --shadow-glow: 0 4px 16px rgba(213, 189, 175, 0.22);

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --nav-height: 70px;
  --container-max: clamp(1180px, 86vw, 2200px);
  --transition-fast: 160ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-base: 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  /* Matching Warm Espresso / Cocoa Dark Palette */
  --bg-primary: #1c1816;
  --bg-secondary: #241f1c;
  --bg-card: rgba(39, 33, 30, 0.92);
  --bg-card-solid: #27211e;
  --bg-elevated: #322a26;
  --bg-glass: rgba(28, 24, 22, 0.9);

  --text-primary: #f5ebe0;
  --text-secondary: #e3d5ca;
  --text-muted: #b8aba1;

  --accent-primary: #d5bdaf;
  --accent-primary-hover: #e3d5ca;
  --accent-secondary: #a3b18a;
  --accent-amber: #ddb892;
  --accent-rose: #cf938b;
  --accent-violet: #bfa8b8;

  --accent-glow: rgba(213, 189, 175, 0.14);
  --accent-soft: rgba(213, 189, 175, 0.14);
  --emerald-soft: rgba(163, 177, 138, 0.14);

  --border-subtle: rgba(214, 204, 194, 0.18);
  --border-strong: rgba(213, 189, 175, 0.42);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.26);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.46);
  --shadow-glow: 0 4px 18px rgba(213, 189, 175, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.68;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Soft Warm Paper Wash (Humanized subtle atmosphere, no cyber grid) */
.bg-grid-pattern {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(circle at 12% 10%, var(--accent-glow), transparent 46%),
    radial-gradient(circle at 88% 82%, var(--emerald-soft), transparent 44%);
  pointer-events: none;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

button, input, textarea, select {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

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

/* Container (scales proportionally on wider/zoomed-out viewports) */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.4vw, 72px);
}

/* Skip Link for Accessibility (HCI Universal Design) */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--accent-primary);
  color: #06101a;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 9999;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   HEADER & PRIMARY NAVIGATION (Menu Selection + Consistency)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--accent-primary);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1rem;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}

.nav-links a.active {
  color: var(--accent-primary);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
}

/* Breadcrumb & Page Progress Bar (Information Organization) */
.page-context-bar {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 10px 0;
  font-size: 0.82rem;
}

.context-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-style: italic;
}

.breadcrumbs a:hover {
  color: var(--accent-primary);
}

.breadcrumbs .current {
  color: var(--text-primary);
  font-weight: 600;
}

.page-pill-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.page-dots {
  display: flex;
  gap: 5px;
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: all var(--transition-fast);
}

.page-dot.active {
  width: 20px;
  border-radius: 99px;
  background: var(--accent-primary);
}

/* ==========================================================================
   MAIN LAYOUT & TYPOGRAPHY
   ========================================================================== */
main {
  flex: 1;
  padding: clamp(28px, 3vw, 56px) 0 clamp(48px, 5vw, 88px);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.section-header {
  margin-bottom: clamp(20px, 2.4vw, 38px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.page-title {
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.16;
  margin-bottom: 12px;
}

.page-lead {
  font-size: 1.04rem;
  color: var(--text-secondary);
  max-width: 720px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.96rem;
  font-style: italic;
}

.gradient-text,
.page-title em,
.hero-title em,
.section-title em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-primary);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}

/* ==========================================================================
   BUTTONS, BADGES, CARDS (Affordance & Visual Feedback)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-primary);
  color: #f5ebe0;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .btn-primary {
  color: #1c1816;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-card-solid);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-primary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: clamp(18px, 1.8vw, 30px);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tag-cyan {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border-color: var(--border-strong);
}

.tag-emerald {
  background: var(--emerald-soft);
  color: var(--accent-secondary);
  border-color: rgba(93, 111, 91, 0.28);
}

.tag-amber {
  background: rgba(150, 102, 61, 0.12);
  color: var(--accent-amber);
  border-color: rgba(150, 102, 61, 0.28);
}

.tag-rose {
  background: rgba(150, 87, 83, 0.12);
  color: var(--accent-rose);
  border-color: rgba(150, 87, 83, 0.28);
}

.tag-violet {
  background: rgba(111, 95, 109, 0.12);
  color: var(--accent-violet);
  border-color: rgba(111, 95, 109, 0.28);
}

/* Grid Helpers */
.grid {
  display: grid;
  gap: clamp(16px, 1.6vw, 28px);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section-block {
  margin-top: clamp(36px, 4vw, 68px);
}

/* Status Badge (calm availability note) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 500;
  color: var(--accent-secondary);
  background: var(--emerald-soft);
  border: 1px solid rgba(93, 111, 91, 0.28);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-secondary);
}

/* ==========================================================================
   HERO & PROFILE AVATAR CARD (index.html)
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: clamp(22px, 2.5vw, 40px);
  align-items: start;
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.16;
  margin-bottom: 14px;
}

.hero-objective {
  font-size: 1.02rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  border-left: 2px solid var(--accent-primary);
  padding-left: 16px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.kpi-val {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--accent-primary);
  line-height: 1.15;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-card {
  position: relative;
  padding: clamp(20px, 2vw, 34px);
  border-radius: var(--radius-lg);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.avatar-ring {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  padding: 3px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  background: var(--bg-primary);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.profile-meta-list {
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.profile-meta-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-meta-list svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* Interactive Track Switcher */
.pill-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.pill-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-tab:hover {
  color: var(--text-primary);
}

.pill-tab.active {
  background: var(--bg-card-solid);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   TIMELINES & LISTS (academics.html, experience.html)
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 30px;
  display: grid;
  gap: 26px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), transparent);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -30px;
  top: 24px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-dot.emerald {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 4px var(--emerald-soft);
}

.clean-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.clean-list li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.clean-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: 700;
}

/* ==========================================================================
   FILTER BAR, SEARCH & MODALS (projects.html)
   ========================================================================== */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.search-box {
  position: relative;
  min-width: 250px;
  flex: 1;
  max-width: 340px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.project-thumb {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Simulated Code / Terminal Snippet inside cards & modals */
.terminal-mock {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
  color: #e3d5ca;
  background: #231e1b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
}

.term-dots {
  display: none;
}

/* Modal Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 180ms ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

/* ==========================================================================
   PROGRESS BARS, METERS & INTERACTIVE CONTROLS (qualities.html, hci-design.html)
   ========================================================================== */
.meter-row {
  margin-bottom: 14px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.meter-track {
  height: 9px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   FORMS & VALIDATION (contact.html — Form Fill-in + Constraints)
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.94rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control.invalid {
  border-color: var(--accent-rose);
}

.form-control.valid {
  border-color: var(--accent-secondary);
}

.field-feedback {
  font-size: 0.78rem;
  margin-top: 5px;
  min-height: 18px;
}

.field-feedback.error { color: var(--accent-rose); }
.field-feedback.ok { color: var(--accent-secondary); }

/* ==========================================================================
   TOAST NOTIFICATION (Norman's Feedback Principle)
   ========================================================================== */
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastIn 180ms ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   NEXT / PREV PAGE PAGER & FOOTER
   ========================================================================== */
.page-pager {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  min-width: 210px;
  transition: all var(--transition-fast);
}

.pager-link:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.pager-dir {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--accent-primary);
}

.pager-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: 28px 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* Experience 2-Photo Gallery (compact side-by-side thumbnails) */
.exp-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 185px));
  gap: 10px;
  margin-top: 14px;
}

.exp-photo-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  cursor: zoom-in;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.exp-photo-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.exp-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  transition: transform 320ms ease;
}

.exp-photo-card:hover img {
  transform: scale(1.04);
}

/* Project Card 2-Photo Gallery (side-by-side, uniform 16:9 ratio, clear gap, captionless) */
.proj-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 16px);
  margin-bottom: 16px;
}

.proj-photo-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  cursor: zoom-in;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.proj-photo-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.proj-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 320ms ease;
}

.proj-photo-card:hover img {
  transform: scale(1.04);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: 14px 20px;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .mobile-menu-btn { display: inline-flex; }
}

@media (max-width: 680px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kbd-hint { display: none; }
  .pill-tabs {
    display: flex;
    width: 100%;
  }
  .pill-tab {
    text-align: left;
  }
  #intern-phase-tabs {
    flex-direction: column;
    align-items: stretch;
  }
  #intern-phase-tabs .pill-tab {
    width: 100%;
  }
}

/* Print optimization for PDF export */
@media print {
  .site-header, .toast-stack { position: static !important; }
  body { background: #ffffff; color: #0f172a; }
}
