/* ===== Design tokens ===== */
:root {
  --bg: #0F1115;
  --surface: #171A21;
  --surface-2: #1D212B;
  --text: #E8E6E1;
  --text-dim: #9AA0AC;
  --accent: #E8A33D;
  --accent-soft: rgba(232,163,61,0.14);
  --teal: #5FB3B3;
  --teal-soft: rgba(95,179,179,0.14);
  --line: #2A2E39;
  --border: #262B36;

  --font-head: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

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

::selection { background: var(--accent); color: #17140C; }

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

/* subtle grain overlay for texture */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  background: transparent;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 0.1s linear;
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,21,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 32px;
  height: 64px;
}
.logo {
  font-family: var(--font-head); font-weight: 700; font-size: 18px;
  letter-spacing: 0.02em; color: var(--text);
}
.main-nav { display: flex; gap: 28px; margin-left: auto; }
.main-nav a { font-size: 14.5px; color: var(--text-dim); transition: color 0.15s; }
.main-nav a:hover { color: var(--text); }
.nav-cta {
  font-size: 14px; padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 20px; height: 2px; background: var(--text); display: block; }
.mobile-nav { display: none; flex-direction: column; padding: 8px 28px 20px; border-top: 1px solid var(--border); }
.mobile-nav a { padding: 12px 0; font-size: 15px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: none; color: var(--accent); }

@media (max-width: 760px) {
  .main-nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .site-header.open .mobile-nav { display: flex; }
}

/* ===== Hero ===== */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
  padding: 88px 28px 64px;
}
.hero-name {
  font-family: var(--font-mono); font-size: 13.5px; color: var(--accent);
  margin-bottom: 16px; letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(30px, 4.2vw, 46px); line-height: 1.14; max-width: 15ch;
}
.nobreak { white-space: nowrap; }
.hero-sub {
  margin-top: 22px; color: var(--text-dim); font-size: 17px; max-width: 48ch;
}

.hero-roles { margin-top: 26px; height: 24px; overflow: hidden; }
.hero-roles-track {
  display: flex; flex-direction: column; gap: 0;
  animation: role-cycle 8s cubic-bezier(0.65,0,0.35,1) infinite;
}
.hero-roles-track span {
  height: 24px; line-height: 24px;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--teal);
}
@keyframes role-cycle {
  0%, 21%   { transform: translateY(0); }
  28%, 46%  { transform: translateY(-24px); }
  53%, 71%  { transform: translateY(-48px); }
  78%, 100% { transform: translateY(-72px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-roles-track { animation: none; }
}

.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 9px;
  font-size: 15px; font-weight: 500; transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--accent); color: #17140C; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-dim); }

.hero-visual svg { width: 100%; height: auto; }
.flow-lines path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.flow-nodes rect { fill: var(--surface); stroke: var(--border); stroke-width: 1; }
.flow-nodes .dot { fill: var(--text-dim); }
.flow-nodes .dot.amber { fill: var(--accent); }
.flow-nodes .dot.teal { fill: var(--teal); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-visual { order: -1; max-width: 340px; margin: 0 auto; }
}

/* ===== About ===== */
.about { padding: 40px 28px 96px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.about-copy p { color: var(--text-dim); font-size: 16.5px; max-width: 52ch; }
.skill-group + .skill-group { margin-top: 22px; }
.skill-group h3 {
  font-size: 12.5px; color: var(--text-dim); font-weight: 500; margin-bottom: 10px;
  font-family: var(--font-mono);
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li {
  font-size: 13.5px; padding: 6px 12px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(232,163,61,0.25);
}
.pills-teal li { background: var(--teal-soft); color: var(--teal); border-color: rgba(95,179,179,0.25); }

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ===== Rail (workflow spine connecting the main sections) ===== */
.rail-wrap { position: relative; }
.rail-line {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 4%, var(--border) 96%, transparent);
  transform: translateX(-0.5px);
}
@media (max-width: 860px) { .rail-line { display: none; } }

.section { padding: 84px 28px; position: relative; }
.section-alt { background: var(--surface); }
.section-head { max-width: 640px; margin: 0 auto 52px; text-align: center; position: relative; }
.rail-node {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 14px; color: var(--accent);
  margin-bottom: 18px; position: relative; z-index: 2;
}
.section-alt .rail-node { background: var(--surface); }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); }
.section-sub { color: var(--text-dim); margin-top: 10px; font-size: 15.5px; }

/* ===== Agent cards ===== */
.agent-card {
  padding: 48px 0; border-bottom: 1px solid var(--border);
}
.agent-card:last-child { border-bottom: none; }

.agent-tabs { display: inline-flex; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; }
.agent-tab {
  border: none; background: transparent; color: var(--text-dim); font-size: 13.5px;
  padding: 7px 16px; border-radius: 6px; cursor: pointer; font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.agent-tab.is-active { background: var(--accent); color: #17140C; }
.agent-tab:not(.is-active):hover { color: var(--text); }

.agent-stage { position: relative; margin-bottom: 28px; }
.agent-stage-single .diagram-frame { margin-bottom: 0; }
.diagram-frame, .video-frame {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; position: relative;
  display: none;
}
.diagram-frame.is-active, .video-frame.is-active { display: block; }
.section-alt .diagram-frame, .section-alt .video-frame { background: var(--surface-2); }
.diagram-label {
  position: absolute; top: 14px; left: 18px; font-family: var(--font-mono);
  font-size: 10.5px; color: var(--text-dim); letter-spacing: 0.02em;
  background: var(--surface); padding: 3px 8px; border-radius: 4px; z-index: 2;
}
.section-alt .diagram-label { background: var(--surface-2); }
.diagram-svg { padding-top: 8px; }
.diagram-svg svg { width: 100%; height: auto; display: block; }
.video-frame video { width: 100%; border-radius: 8px; display: block; background: #000; max-height: 520px; margin: 0 auto; }

.agent-copy h3 { font-size: 22px; }
.agent-status {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--teal);
  margin-top: 8px;
}
.agent-copy p:not(.agent-status) { color: var(--text-dim); margin-top: 14px; font-size: 15px; max-width: 62ch; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag-list li {
  font-size: 12.5px; padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--text-dim); font-family: var(--font-mono);
}

/* workflow diagram internals (interactive) */
.wf-node rect { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.3; cursor: pointer; transition: stroke 0.15s, fill 0.15s, opacity 0.2s; }
.section-alt .wf-node rect { fill: var(--surface); }
.wf-text { fill: var(--text); font-family: var(--font-body); font-size: 13px; transition: opacity 0.2s; }
.wf-node-amber rect { stroke: var(--accent); }
.wf-node-teal rect { stroke: var(--teal); }
.wf-node:hover rect, .wf-node:focus rect, .wf-node.is-hover rect { fill: var(--accent-soft); stroke: var(--accent); }
.wf-node.is-dim rect { opacity: 0.35; }
.wf-node.is-dim .wf-text { opacity: 0.35; }
.wf-node:focus { outline: none; }

.wf-edge { fill: none; stroke: var(--line); stroke-width: 1.5; transition: stroke 0.15s, opacity 0.2s; }
.wf-edge-dashed { stroke-dasharray: 5 5; }
.wf-edge.is-active { stroke: var(--accent); }
.wf-edge.is-dim { opacity: 0.25; }
.wf-edge-label-bg { fill: var(--surface); }
.section-alt .wf-edge-label-bg { fill: var(--surface-2); }
.wf-edge-label { fill: var(--text-dim); font-family: var(--font-mono); font-size: 10px; }
.wf-flow-dot { fill: var(--accent); opacity: 0.85; }

.wf-tooltip {
  position: absolute; max-width: 280px; padding: 10px 13px; border-radius: 9px;
  background: #21252F; border: 1px solid var(--border); color: var(--text);
  font-size: 13px; line-height: 1.45; pointer-events: none; opacity: 0; z-index: 5;
  transform: translate(-50%, -100%); transition: opacity 0.12s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.wf-tooltip.is-visible { opacity: 1; }

@media (max-width: 700px) {
  .diagram-svg svg { min-width: 640px; }
  .diagram-frame { overflow-x: auto; }
  .wf-tooltip { display: none; }
}

/* ===== Data filters ===== */
.data-filters { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.data-filter {
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  font-size: 13px; padding: 7px 15px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-body); transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.data-filter:hover { color: var(--text); border-color: var(--text-dim); }
.data-filter.is-active { background: var(--accent); border-color: var(--accent); color: #17140C; }

/* ===== Data table ===== */
.data-table { border-top: 1px solid var(--border); }
.data-row.is-hidden { display: none; }
.data-row {
  display: grid; grid-template-columns: 1.1fr 0.55fr 1.6fr 0.6fr;
  gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border);
}
.data-row-head {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim);
  padding-bottom: 14px;
}
.data-name { font-weight: 500; font-size: 15px; }
.data-tool {
  font-family: var(--font-mono); font-size: 12px; padding: 4px 9px; border-radius: 6px;
  width: fit-content;
}
.tool-excel { background: rgba(95,179,179,0.14); color: var(--teal); }
.tool-powerbi { background: rgba(232,163,61,0.14); color: var(--accent); }
.tool-sql { background: rgba(232,163,61,0.14); color: var(--accent); }
.data-desc { color: var(--text-dim); font-size: 14px; }
.data-link { font-size: 13.5px; color: var(--text); border-bottom: 1px solid var(--border); white-space: nowrap; justify-self: start; }
.data-link:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 760px) {
  .data-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 16px; background: var(--bg); border-radius: 10px; margin-bottom: 12px; border: 1px solid var(--border); }
  .section-alt .data-row { background: var(--surface-2); }
  .data-row-head { display: none; }
  .data-link { margin-top: 6px; }
}

/* ===== University cards ===== */
.uni-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.uni-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 26px; transition: border-color 0.15s;
}
.uni-card:hover { border-color: var(--teal); }
.uni-card h3 { font-size: 17px; margin-bottom: 10px; }
.uni-card p { color: var(--text-dim); font-size: 14px; }
.uni-link { display: inline-block; margin-top: 16px; font-size: 13.5px; color: var(--teal); }

@media (max-width: 700px) { .uni-grid { grid-template-columns: 1fr; } }

/* ===== Contact ===== */
.section-contact { padding-bottom: 100px; }
.contact-grid {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px;
  max-width: 760px; margin: 0 auto; align-items: center;
}
.contact-profile { display: flex; align-items: center; gap: 16px; }
.profile-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.contact-name { font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.contact-loc { color: var(--text-dim); font-size: 13.5px; margin-top: 3px; }

.contact-links { display: grid; gap: 10px; }
.contact-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: 9px;
  transition: border-color 0.15s, background 0.15s;
}
.contact-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.contact-label { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
.contact-value { font-size: 14px; }

@media (max-width: 700px) {
  .contact-grid { grid-template-columns: 1fr; text-align: left; }
}

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 26px 28px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer span { font-size: 13px; color: var(--text-dim); }
