/* ================================================================
   ardiancandra.com — core styles
   Palette: cream paper + deep forest + sage + ochre + slate + ink
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --cream: #FBFBF7;
  --paper: #F5EFE0;
  --paper-2: #EEE5CE;
  --ink: #6B2E1E;          /* terracotta ink for sketch lines */
  --ink-soft: #8B4030;
  --forest: #1B4332;
  --forest-2: #143329;
  --sage: #52B788;
  --sage-2: #74C69D;
  --ochre: #F4A261;
  --ochre-2: #E8A548;
  --slate: #264653;
  --terra: #C44536;
  --charcoal: #1F1F1F;
  --mute: #6B7564;
  --line: rgba(27, 67, 50, 0.14);
  --line-strong: rgba(27, 67, 50, 0.28);

  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--forest-2);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* subtle paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(107, 46, 30, 0.025) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(38, 70, 83, 0.02) 0, transparent 40%);
  z-index: 1;
  mix-blend-mode: multiply;
}

/* dotted-paper bg for landing only */
.paper-dots {
  background-image:
    radial-gradient(circle, rgba(107, 46, 30, 0.18) 0.8px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: 0 0;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--forest-2);
  margin: 0;
}
h1 { font-size: clamp(44px, 6vw, 88px); line-height: 1.02; }
h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.1; }
h3 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; }

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--terra); }

.mono { font-family: var(--mono); font-size: 0.82em; letter-spacing: 0.02em; }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }
.muted { color: var(--mute); }

/* ============== Navigation ============== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(251, 251, 247, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--forest-2);
}
.nav-brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--terra);
  display: inline-block;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a {
  color: var(--forest-2);
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--terra); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--terra);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
  background: var(--cream);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--mute);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.lang-toggle button.active {
  background: var(--forest-2);
  color: var(--cream);
}

/* ============== Section frame ============== */
section {
  padding: 100px 40px;
  position: relative;
  z-index: 2;
}
.section-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-tag::before {
  content: '§';
  font-family: var(--serif);
  font-size: 20px;
  color: var(--terra);
}
.container {
  max-width: 1240px;
  margin: 0 auto;
}
.container-narrow {
  max-width: 860px;
  margin: 0 auto;
}

/* ============== Buttons / pills ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--forest-2);
  background: var(--forest-2);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover {
  background: var(--terra);
  border-color: var(--terra);
  color: var(--cream);
}
.btn-ghost {
  background: transparent;
  color: var(--forest-2);
}
.btn-ghost:hover {
  background: var(--forest-2);
  color: var(--cream);
}
.pill {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--forest);
  background: rgba(82, 183, 136, 0.08);
}

/* ============== Cards ============== */
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover {
  border-color: var(--line-strong);
}

/* ============== Hand-drawn keyframes (landing) ============== */
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes spin-med  { to { transform: rotate(360deg); } }
@keyframes spin-fast { to { transform: rotate(360deg); } }
@keyframes bob       { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
@keyframes wave-shift{ to { transform: translateX(-64px); } }
@keyframes cloud-drift{ to { transform: translateX(30px); } }
@keyframes pulse-ink { 0%,100%{opacity:.8} 50%{opacity:1} }
@keyframes sketch-in {
  to { stroke-dashoffset: 0; }
}
@keyframes flicker-led {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes charge-flow {
  to { stroke-dashoffset: -40; }
}

/* hand-drawn stroke */
.ink { stroke: var(--ink); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ink-thin { stroke: var(--ink); fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ink-fill { fill: var(--ink); }
.ink-soft { stroke: var(--ink-soft); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ============== Utilities ============== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav { padding: 14px 20px; }
  .nav-links { display: none; }
  section { padding: 70px 20px; }
}

/* ============== Chart surfaces ============== */
.chart-surface {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

/* ============== Sim tabs ============== */
.sim-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
  overflow-x: auto;
}
.sim-tab {
  padding: 14px 18px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sim-tab .num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--terra);
}
.sim-tab:hover { color: var(--forest-2); }
.sim-tab.active {
  color: var(--forest-2);
  border-bottom-color: var(--terra);
}

.slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.slider-row .label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.slider-row .value {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--forest-2);
}
input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  margin: 8px 0 20px;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line-strong);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--terra);
  border: 3px solid var(--cream);
  margin-top: -9px;
  box-shadow: 0 0 0 1px var(--terra);
  cursor: pointer;
}
input[type=range]::-moz-range-track {
  height: 2px; background: var(--line-strong);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--terra);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 1px var(--terra);
  cursor: pointer;
}

.metric {
  border-left: 2px solid var(--line);
  padding: 6px 0 6px 16px;
}
.metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}
.metric-value {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.05;
  color: var(--forest-2);
  margin-top: 2px;
}
.metric-value .unit {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--mute);
  margin-left: 4px;
  font-weight: 400;
}

/* experience timeline */
.exp-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.exp-item:first-child { border-top: 0; }
.exp-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
}
.exp-role {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--forest-2);
  margin-bottom: 4px;
}
.exp-org {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--terra);
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.exp-bullets {
  margin: 0; padding: 0 0 0 16px;
  font-size: 14.5px; line-height: 1.6;
  color: var(--forest-2);
}
.exp-bullets li { margin-bottom: 6px; }

@media (max-width: 720px) {
  .exp-item { grid-template-columns: 1fr; gap: 10px; }
}

/* writings cards */
.writing-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--cream);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.writing-card:hover {
  border-color: var(--forest-2);
  transform: translateY(-2px);
}
.writing-card.featured {
  background: var(--forest-2);
  color: var(--cream);
  grid-column: span 2;
}
.writing-card.featured h3 { color: var(--cream); }
.writing-card.featured .pill {
  border-color: rgba(255,255,255,0.25);
  background: transparent;
  color: var(--sage-2);
}
.writing-visual {
  height: 180px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.writing-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.writing-meta {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mute);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.writing-card.featured .writing-meta { color: var(--sage-2); }
