/* ==========================================================================
   Saw Yan Naung — Portfolio
   Theme: warm rice-paper + ink, muted crimson accent (a quiet nod to
   heritage), restrained and modern. Light + dark.
   ========================================================================== */

:root {
  /* Light — warm paper */
  --bg:        #f6f1e9;
  --bg-2:      #efe8dc;
  --surface:   #fffdf8;
  --ink:       #211c19;
  --muted:     #6b625b;
  --hair:      #e2d8c8;
  --accent:    #9e2b25;   /* muted crimson */
  --accent-2:  #7a1f1b;
  --gold:      #b28a4c;   /* used sparingly */
  --shadow:    0 1px 2px rgba(33,28,25,.05), 0 12px 32px -18px rgba(33,28,25,.35);

  --maxw: 1080px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg:        #16110f;
  --bg-2:      #1c1613;
  --surface:   #201914;
  --ink:       #f1e9df;
  --muted:     #a99c90;
  --hair:      #362b25;
  --accent:    #d8524b;
  --accent-2:  #e6857e;
  --gold:      #cba86a;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 18px 40px -22px rgba(0,0,0,.8);
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint paper texture */
  background-image:
    radial-gradient(circle at 15% 20%, rgba(158,43,37,.04), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(178,138,76,.05), transparent 45%);
  transition: background-color .4s ease, color .4s ease;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--hair); }

.nav__brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.nav__name { font-family: var(--font-display); font-size: 1.02rem; letter-spacing: .01em; }
@media (max-width: 560px){ .nav__name { display: none; } }

/* Seal / chop — a stylized nod, not a literal stamp */
.seal {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.22), var(--shadow);
  position: relative;
}
.seal::after {
  content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.3); border-radius: 5px;
}
.seal__mark {
  font-family: var(--font-display); font-weight: 600; font-size: .62rem; letter-spacing: .06em;
  color: #f6f1e9;
}

.nav__links { display: flex; gap: 1.4rem; font-size: .92rem; }
.nav__links a { color: var(--muted); position: relative; padding: .2rem 0; transition: color .2s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }
@media (max-width: 780px){ .nav__links { display: none; } }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--hair); border-radius: 9px; background: var(--surface);
  color: var(--ink); cursor: pointer; transition: border-color .2s, transform .15s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ===== LAYOUT ===== */
.hero, .section { padding-left: var(--pad); padding-right: var(--pad); }
.section { max-width: var(--maxw); margin: 0 auto; padding-top: clamp(3.5rem, 8vw, 6rem); padding-bottom: clamp(1rem, 3vw, 2rem); }

/* ===== HERO ===== */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding-top: clamp(3rem, 10vw, 7rem); padding-bottom: clamp(2rem, 6vw, 4rem);
  position: relative;
}
.hero::before { /* soft warm accent glow, top-right */
  content: ""; position: absolute; right: clamp(-3rem, 1vw, 0rem); top: -1rem;
  width: clamp(13rem, 32vw, 24rem); height: clamp(13rem, 32vw, 24rem);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.hero__inner { position: relative; max-width: 46rem; }

.eyebrow {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.4rem;
}
.hero__title { font-size: clamp(2.7rem, 8vw, 5rem); font-weight: 400; }
.hero__alias { color: var(--muted); font-style: italic; font-weight: 400; }
.hero__role { font-size: clamp(1.15rem, 2.6vw, 1.5rem); margin-top: .6rem; color: var(--ink); font-family: var(--font-display); }
.hero__role strong { color: var(--accent); font-weight: 600; }
.hero__lead { margin-top: 1.4rem; font-size: 1.06rem; color: var(--muted); max-width: 40rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .72rem 1.3rem; border-radius: 999px; font-size: .92rem; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { border-color: var(--hair); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--text { color: var(--muted); padding-left: .6rem; padding-right: .6rem; }
.btn--text:hover { color: var(--accent); }

.hero__facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; padding: 0;
  margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--hair);
}
.hero__facts li { display: flex; flex-direction: column; gap: .15rem; }
.fact__k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact__v { font-size: .95rem; font-weight: 500; }

/* ===== SECTION HEADS ===== */
.section__head { display: flex; align-items: baseline; gap: .9rem; margin-bottom: 2.2rem; }
.section__no { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); letter-spacing: .05em; }
.section__head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }

/* ===== ABOUT ===== */
.about { max-width: 46rem; display: grid; gap: 1.1rem; }
.about__lead { font-size: 1.25rem; font-family: var(--font-display); line-height: 1.5; }
.about p, .about__lead { color: var(--ink); }
.about p:not(.about__lead) { color: var(--muted); }

/* ===== CARDS ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px;
  padding: 1.5rem; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0; transition: opacity .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--hair)); }
.card:hover::before { opacity: 1; }
.card__index { color: var(--accent); font-size: .8rem; }
.card h3 { font-size: 1.2rem; margin: .5rem 0 .5rem; }
.card p { color: var(--muted); font-size: .94rem; }
.tags { list-style: none; padding: 0; margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li {
  font-size: .74rem; font-family: var(--font-mono); color: var(--muted);
  border: 1px solid var(--hair); border-radius: 6px; padding: .22rem .55rem;
}

/* ===== TIMELINE ===== */
.timeline { display: grid; gap: 0; max-width: 52rem; }
.tl {
  display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem;
  padding: 1.8rem 0; border-top: 1px solid var(--hair);
}
.tl:last-child { border-bottom: 1px solid var(--hair); }
.tl__meta { display: flex; flex-direction: column; gap: .5rem; }
.tl__date { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.tl__badge {
  align-self: start; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px; padding: .18rem .6rem;
}
.tl__body h3 { font-size: 1.25rem; }
.tl__org { color: var(--accent); font-size: .92rem; margin: .2rem 0 .7rem; font-weight: 500; }
.tl__body ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .95rem; display: grid; gap: .35rem; }
.tl__body li::marker { color: var(--accent); }
@media (max-width: 620px){
  .tl { grid-template-columns: 1fr; gap: .7rem; }
  .tl__meta { flex-direction: row; align-items: center; gap: .8rem; }
}

/* ===== SKILLS ===== */
.skills { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; max-width: 52rem; }
@media (max-width: 700px){ .skills { grid-template-columns: 1fr; gap: 2rem; } }
.skills__label { font-size: 1.05rem; margin-bottom: 1rem; color: var(--muted); font-family: var(--font-mono); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; font-size: .78rem; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 8px;
  padding: .45rem .8rem; font-size: .88rem; transition: border-color .2s, color .2s;
}
.chips li:hover { border-color: var(--accent); color: var(--accent); }

.langs { list-style: none; padding: 0; display: grid; gap: 1.1rem; }
.lang__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; font-size: .95rem; }
.lang__level { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.meter { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transform-origin: left; }

/* ===== CONTACT ===== */
.contact { max-width: var(--maxw); }
.contact__inner {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 22px;
  padding: clamp(2rem, 5vw, 3.5rem); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.contact__inner::after {
  content: ""; position: absolute; right: -3rem; bottom: -4rem;
  width: 16rem; height: 16rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.contact__inner .section__no { display: block; margin-bottom: .4rem; }
.contact__inner h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
.contact__lead { color: var(--muted); margin: .8rem 0 2rem; max-width: 34rem; }
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; }
.contact__item {
  background: var(--surface); padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: .3rem;
  transition: background-color .2s;
}
.contact__item:not(.contact__item--static):hover { background: var(--bg-2); }
.contact__k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact__v { font-size: .98rem; font-weight: 500; word-break: break-word; }

/* ===== FOOTER ===== */
.footer {
  max-width: var(--maxw); margin: 3rem auto 2rem; padding: 1.6rem var(--pad) 0;
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .85rem; color: var(--muted);
}
.footer a:hover { color: var(--accent); }

/* ===== SELECTED WORK / CASE STUDIES ===== */
.work__intro { max-width: 42rem; color: var(--muted); font-size: 1.06rem; margin-bottom: 2rem; }
.work { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.study {
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px;
  padding: 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: border-color .25s ease, transform .25s ease;
}
.study:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--hair)); }
.study__top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.study__tag { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.study__draft {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px dashed var(--hair); border-radius: 999px; padding: .12rem .5rem;
}
.study h3 { font-size: 1.18rem; margin-bottom: 1rem; }
.study__steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.study__steps li { display: grid; gap: .15rem; padding-left: .9rem; border-left: 2px solid var(--hair); }
.study__k {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.study__steps p { font-size: .93rem; color: var(--ink); margin: 0; }
.study__result { border-left-color: var(--accent); }
.study__result .study__k { color: var(--accent); }
.study__result p { font-weight: 500; }

/* Draft placeholder text — signals "replace me" without looking broken */
.ph { color: var(--muted); font-style: italic; }

/* ===== REVEAL ANIMATION ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px;
}
