/* ==========================================================================
   Personal résumé site — single page, no build step
   Visual language: editorial / quiet luxury
   warm paper ground · ink text · single copper accent · hairline rules
   ========================================================================== */

:root {
  /* ground */
  --bg:        #faf9f7;
  --bg-elev:   #ffffff;
  --bg-subtle: #f4f2ee;

  /* ink */
  --text:      #14161a;
  --text-soft: #4a4e56;
  --text-mute: #8b9099;

  /* hairlines */
  --line:      rgba(20, 22, 26, .12);
  --line-soft: rgba(20, 22, 26, .07);

  /* accent — single, used sparingly */
  --accent:     #8a5a2b;
  --accent-mid: #a9713a;
  --accent-ink: #6d451f;
  --accent-wash: rgba(138, 90, 43, .07);

  --shadow-sm: 0 1px 2px rgba(18, 20, 26, .05);
  --shadow-md: 0 6px 18px rgba(18, 20, 26, .07);
  --shadow-lg: 0 24px 60px rgba(18, 20, 26, .10);

  --radius: 3px;
  --radius-sm: 2px;

  --wrap: 1060px;
  --gutter: 40px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

html[data-theme="dark"] {
  --bg:        #0e0f12;
  --bg-elev:   #15171b;
  --bg-subtle: #191c21;

  --text:      #eceae6;
  --text-soft: #b4b2ad;
  --text-mute: #807f7b;

  --line:      rgba(236, 234, 230, .14);
  --line-soft: rgba(236, 234, 230, .08);

  --accent:     #c9a072;
  --accent-mid: #d8b58a;
  --accent-ink: #e3c69e;
  --accent-wash: rgba(201, 160, 114, .09);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

/* ultra-fine paper grain — keeps flat colour from looking digital */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 1; }

h1, h2, h3, h4 { line-height: 1.22; margin: 0; font-weight: 600; letter-spacing: -.018em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  font-size: 13px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 74px;
}

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 2px;
  margin-inline-start: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  position: relative;
  padding: 6px 12px;
  font-size: 13.5px;
  letter-spacing: .01em;
  color: var(--text-mute);
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }
.nav a.active { color: var(--text); font-weight: 500; }
.nav a.active::after { transform: scaleX(1); }

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

.icon-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-mute);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.scroll-progress { height: 1px; width: 0; background: var(--accent); transition: width .1s linear; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 26px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .015em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .24s var(--ease);
  white-space: nowrap;
}
.btn-sm { height: 34px; padding: 0 15px; font-size: 12.5px; }

/* solid ink button — reads more expensive than a saturated blue */
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(18, 20, 26, .12);
}

.btn-outline { border-color: var(--line); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--text); }

.btn-ghost { border-color: var(--line); color: var(--text-mute); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 84px;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -30%; left: -10%;
  width: 62%; height: 150%;
  background: radial-gradient(ellipse at center, var(--accent-wash), transparent 68%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -6%; bottom: -40%;
  width: 46%; height: 130%;
  background: radial-gradient(ellipse at center, rgba(20, 22, 26, .045), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(272px, .8fr);
  gap: 64px;
  align-items: start;
}

/* live particle field — sits behind the hero copy */
.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;   /* never block clicks or text selection */
  opacity: .85;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
}

.hero-name {
  font-size: clamp(44px, 7.2vw, 76px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.02;
}
.hero-role {
  margin-top: 18px;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 400;
  letter-spacing: .005em;
  color: var(--text-soft);
}
.hero-role::after {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-left: 12px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--accent);
}
.hero-summary {
  margin-top: 26px;
  max-width: 58ch;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.85;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 34px;
  font-size: 13.5px;
  color: var(--text-mute);
}
.hero-meta li { display: inline-flex; align-items: center; gap: 9px; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* contact rail */
.hero-card {
  padding: 30px 0 0;
  border-top: 1px solid var(--text);
}

.avatar {
  width: 66px; height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-ink);
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  margin-bottom: 24px;
}

.contact-mini { display: grid; gap: 0; font-size: 13.5px; }
.contact-mini li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.contact-mini li:first-child { border-top: 1px solid var(--line-soft); }
.contact-mini .k {
  width: 15px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
}
.contact-mini a {
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.contact-mini a:hover { color: var(--accent); }

.hero-card-note {
  margin-top: 22px;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--text-mute);
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; border-bottom: 1px solid var(--line-soft); counter-increment: sec; }
.section:last-of-type { border-bottom: 0; }
main { counter-reset: sec; }

.section-title {
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 500;
  letter-spacing: -.03em;
}
.section-title::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-sub {
  margin-top: 14px;
  color: var(--text-mute);
  font-size: 14.5px;
  max-width: 64ch;
}
.section-sub::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 30px;
  background: var(--line);
}

.prose { margin-top: 34px; display: grid; gap: 18px; max-width: 72ch; }
.prose p { color: var(--text-soft); font-size: 15.5px; line-height: 1.85; }

/* stats — no boxes, just hairline-separated numerals */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-top: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 22px 0;
  border-left: 1px solid var(--line-soft);
  padding-left: 20px;
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-value {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -.035em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 6px;
}

/* ---------- Skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 0 48px;
  margin-top: 8px;
}
.skill-card {
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
}
.skill-card h3 {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 16px;
  transition: color .2s var(--ease);
}
.skill-card:hover h3 { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.chips li {
  font-size: 13.5px;
  letter-spacing: .005em;
  color: var(--text-soft);
  padding: 3px 0;
  transition: color .2s var(--ease);
}
.chips li::after {
  content: "·";
  margin-left: 7px;
  color: var(--text-mute);
  opacity: .55;
}
.chips li:last-child::after { content: ""; margin-left: 0; }
.chips li:hover { color: var(--accent); }

.chips.small li { font-size: 12.5px; }

/* ---------- Timeline ---------- */
.timeline { margin-top: 12px; }
.timeline-item {
  position: relative;
  padding: 32px 0 32px 0;
  border-bottom: 1px solid var(--line-soft);
}
.timeline-item:first-child { padding-top: 26px; }
.timeline-item:last-child { border-bottom: 0; }

.timeline-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 24px;
  align-items: baseline;
}
.timeline-head h3 { font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.company {
  grid-column: 1;
  font-size: 14.5px;
  color: var(--accent);
  font-weight: 400;
}
.period {
  grid-row: 1 / span 2;
  grid-column: 2;
  text-align: right;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--text-mute);
  white-space: nowrap;
}

.bullets { margin-top: 16px; display: grid; gap: 9px; max-width: 76ch; }
.bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 14.8px;
  line-height: 1.8;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px; top: 12px;
  width: 8px; height: 1px;
  background: var(--accent);
  opacity: .75;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  margin-top: 4px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: 34px 32px;
  transition: background-color .3s var(--ease);
}
.project-card:hover { background: var(--bg-elev); }

.project-head { display: flex; align-items: baseline; gap: 14px; }
.project-head h3 { font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.project-year {
  margin-inline-start: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--text-mute);
}
.project-card p { margin-top: 14px; font-size: 14.5px; line-height: 1.8; color: var(--text-soft); }
.project-card .chips { margin-top: 18px; }
.project-card .chips li { color: var(--text-mute); font-size: 12.5px; }

.project-impact {
  margin-top: 20px !important;
  padding-left: 16px !important;
  border-left: 1px solid var(--accent);
  background: none !important;
  border-top: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  font-size: 13.8px;
  line-height: 1.75;
  color: var(--text-soft);
}
.project-impact strong {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 8px;
}

.project-links { display: flex; gap: 20px; margin-top: 22px; }
.project-links a {
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.project-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Contact ---------- */
.section-contact { background: var(--bg-subtle); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  margin-top: 4px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 24px;
  background: var(--bg-subtle);
  transition: background-color .25s var(--ease);
}
.contact-item:hover { background: var(--bg-elev); }
.contact-key {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.contact-value { font-size: 15px; font-weight: 400; word-break: break-word; letter-spacing: -.01em; }
.contact-item:hover .contact-value { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { padding: 34px 0; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-mute);
}
.footer-note { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; opacity: .85; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 46px; }
  .hero-card { max-width: 440px; }
}

@media (max-width: 720px) {
  :root { --gutter: 22px; }
  .header-inner { height: 62px; gap: 14px; flex-wrap: wrap; }
  .nav { margin-inline-start: 0; order: 3; flex-basis: 100%; padding-bottom: 4px; }
  .site-header { position: static; }
  html { scroll-padding-top: 0; }
  #printBtn { display: none; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 58px 0; }
  .skill-grid { gap: 0; }
  .timeline-head { grid-template-columns: 1fr; }
  .period { grid-row: auto; grid-column: 1; text-align: left; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding-left: 16px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .project-card { padding: 28px 24px; }
}

@media (max-width: 420px) {
  .hero-actions .btn { flex: 1 1 auto; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; padding-left: 0; }
}

/* ==========================================================================
   Print / PDF export
   ========================================================================== */
@media print {
  :root {
    --bg: #fff; --bg-elev: #fff; --bg-subtle: #fff;
    --text: #111; --text-soft: #333; --text-mute: #666;
    --line: #ccc; --line-soft: #e0e0e0;
    --accent: #6d451f; --accent-wash: #f6f2ec; --accent-ink: #6d451f;
  }
  html, body { background: #fff; font-size: 11pt; }
  body::before { display: none !important; }

  .no-print, .site-header, .scroll-progress, .hero-actions,
  .project-links, .skip-link, .footer-note, .hero-particles { display: none !important; }

  main { counter-reset: sec; }
  .hero { padding: 0 0 16pt; border-bottom: 1px solid #bbb; }
  .hero::before, .hero::after { display: none; }
  .hero-inner { display: block; }
  .hero-card { display: none; }
  .hero-name { font-size: 26pt; }
  .section { padding: 18pt 0; border-bottom: 1px solid #e5e5e5; }
  .section-contact { background: none; }
  .reveal { opacity: 1 !important; transform: none !important; }

  .project-grid, .contact-grid { background: none; border: 0; gap: 12pt; }
  .project-card { border: 1px solid #ddd; padding: 12pt; background: #fff; }
  .contact-item { border: 1px solid #ddd; background: #fff; }
  .stats { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }

  .skill-card, .timeline-item, .project-card, .stat, .contact-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  h2, h3 { break-after: avoid; }
  .site-footer { border-top: 1px solid #ccc; padding: 10pt 0; }
  a { color: #111; }
  @page { margin: 14mm; }
}
