/* ==========================================================================
   marthateye.com — design system
   Plain CSS
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg:        #FAF9F6;
  --bg-elev:   #FFFFFF;
  --bg-sunk:   #F2F0EA;
  --text:      #14181C;
  --text-soft: #3C464F;
  --muted:     #5E6874;
  --line:      #E4E1D9;
  --accent:    #1F6F6B;
  --accent-hi: #14544F;
  --accent-soft:#E6F0EF;
  --gold:      #A5661A;
  --gold-soft: #F7EEDF;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(20,24,28,.05), 0 8px 24px -12px rgba(20,24,28,.14);
  --shadow-lg: 0 2px 4px rgba(20,24,28,.05), 0 24px 48px -20px rgba(20,24,28,.22);

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1120px;
  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 7.5rem);
}

html[data-theme="dark"] {
  --bg:        #0E1113;
  --bg-elev:   #161A1D;
  --bg-sunk:   #0A0D0F;
  --text:      #EAEEF1;
  --text-soft: #C2CBD3;
  --muted:     #96A1AB;
  --line:      #262C32;
  --accent:    #5FCEC2;
  --accent-hi: #8BE0D6;
  --accent-soft:#122A29;
  --gold:      #DFA85C;
  --gold-soft: #2A2213;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -20px rgba(0,0,0,.7);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: var(--section-y); border-top: 1px solid var(--line); }
.section--sunk { background: var(--bg-sunk); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
p { text-wrap: pretty; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
  display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem;
}
.eyebrow::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.section-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -.02em; margin-bottom: .6rem;
}
.section-lede { color: var(--muted); font-size: 1.03rem; max-width: 58ch; margin-bottom: 3rem; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.header.is-stuck { border-bottom-color: var(--line); }
.header__inner { display: flex; align-items: center; gap: 1rem; height: 66px; }
.brand {
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap; margin-right: auto;
}
.brand span { color: var(--accent); }
.nav { display: flex; gap: .25rem; align-items: center; }
.nav a {
  text-decoration: none; font-size: .9rem; color: var(--muted);
  padding: .45rem .7rem; border-radius: 999px; transition: color .18s, background .18s;
}
.nav a:hover { color: var(--text); background: var(--bg-sunk); }
.nav a.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: 10px;
  cursor: pointer; transition: border-color .18s, transform .18s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--bg-elev); border-bottom: 1px solid var(--line);
    padding: .75rem var(--gut) 1.25rem; gap: .1rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: .7rem .8rem; font-size: 1rem; border-radius: var(--radius-sm); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.25rem; border-radius: 999px; text-decoration: none;
  font-size: .92rem; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s, background .18s, border-color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
html[data-theme="dark"] .btn--primary { color: #08211F; }
.btn--primary:hover { background: var(--accent-hi); }
.btn--ghost { border-color: var(--line); background: var(--bg-elev); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6rem); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -30%; right: -10%; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 68%);
  pointer-events: none; z-index: -1;
}
.hero__grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .82rem; color: var(--text-soft);
  background: var(--bg-elev); border: 1px solid var(--line);
  padding: .38rem .85rem .38rem .6rem; border-radius: 999px; margin-bottom: 1.6rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.9rem, 7.5vw, 4.6rem); letter-spacing: -.025em; line-height: 1.02; margin-bottom: 1rem;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero__role {
  font-family: var(--font-mono); font-size: .84rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.4rem;
}
.hero__bio { font-size: 1.09rem; color: var(--text-soft); max-width: 54ch; margin-bottom: 2rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 2rem; }
.social { display: flex; gap: .5rem; flex-wrap: wrap; }
.social a {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg-elev);
  color: var(--muted); transition: .18s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social svg { width: 19px; height: 19px; }

.portrait { position: relative; }
.portrait img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center top;
  border-radius: 20px; box-shadow: var(--shadow-lg);
}
.portrait::after {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1;
  border: 1px solid var(--accent); border-radius: 20px; opacity: .5;
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .portrait { max-width: 320px; }
  .portrait::after { inset: 12px -12px -12px 12px; }
}

/* ---------- Stat strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { background: var(--bg); padding: 1.6rem 1.25rem; text-align: center; }
.stat__n { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--accent); }
.stat__l { font-size: .78rem; color: var(--muted); letter-spacing: .04em; margin-top: .45rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- News ---------- */
.news { display: grid; gap: 0; }
.news__item {
  display: grid; grid-template-columns: 108px 1fr; gap: 1.5rem;
  padding: 1.35rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.news__item:first-child { border-top: 1px solid var(--line); }
.news__date { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); letter-spacing: .03em; }
.news__body { color: var(--text-soft); font-size: .98rem; }
.news__body strong { color: var(--text); font-weight: 600; }
.news__body a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
@media (max-width: 640px) { .news__item { grid-template-columns: 1fr; gap: .3rem; } }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about p + p { margin-top: 1.1rem; }
.about p { color: var(--text-soft); }
.pillars { display: grid; gap: 1rem; }
.pillar {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem; transition: border-color .2s, transform .2s;
}
.pillar:hover { border-color: var(--accent); transform: translateY(-2px); }
.pillar__ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: .85rem; }
.pillar__ic svg { width: 19px; height: 19px; }
.pillar h3 { font-size: 1rem; margin-bottom: .3rem; }
.pillar p { font-size: .9rem; color: var(--muted); line-height: 1.55; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* ---------- Publications ---------- */
.pubs { display: grid; gap: 1rem; }
.pub {
  position: relative; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.6rem;
  display: grid; grid-template-columns: 88px 1fr; gap: 1.5rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.pub:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.pub__meta { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.pub__venue {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .06em;
  background: var(--accent-soft); color: var(--accent); padding: .28rem .55rem; border-radius: 6px; white-space: nowrap;
}
.pub__year { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.pub h3 { font-size: 1.08rem; line-height: 1.4; margin-bottom: .45rem; }
.pub__authors { font-size: .88rem; color: var(--muted); margin-bottom: .8rem; }
.pub__authors .me { color: var(--text); font-weight: 600; }
.pub__links { display: flex; flex-wrap: wrap; gap: .45rem; }
.pub__links a {
  font-size: .78rem; text-decoration: none; color: var(--text-soft);
  border: 1px solid var(--line); border-radius: 7px; padding: .28rem .6rem;
  display: inline-flex; align-items: center; gap: .3rem; transition: .16s;
}
.pub__links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.award {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  background: var(--gold-soft); color: var(--gold);
  padding: .25rem .6rem; border-radius: 6px; margin-bottom: .6rem;
}
.award svg { width: 13px; height: 13px; }
@media (max-width: 700px) {
  .pub { grid-template-columns: 1fr; gap: .9rem; padding: 1.3rem; }
  .pub__meta { flex-direction: row; align-items: center; gap: .6rem; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl { position: relative; padding-bottom: 2.75rem; }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute; left: -2rem; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl--now::before { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.tl__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-bottom: .35rem; }
.tl__date { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); letter-spacing: .03em; }
.tl h3 { font-size: 1.12rem; }
.tl__org { color: var(--accent); font-weight: 500; font-size: .95rem; margin-bottom: .6rem; }
.tl__desc { color: var(--text-soft); font-size: .95rem; max-width: 62ch; margin-bottom: .9rem; }
.tl__list { list-style: none; padding: 0; display: grid; gap: .4rem; }
.tl__list li { position: relative; padding-left: 1.15rem; font-size: .9rem; color: var(--muted); }
.tl__list li::before { content: "\25B8"; position: absolute; left: 0; color: var(--accent); font-size: .8rem; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem 2.5rem; }
.skillgroup h3 { font-size: .78rem; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .85rem; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .84rem; padding: .32rem .72rem; border-radius: 7px;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--text-soft);
  transition: .16s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 1.25rem; }
.card {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); transform: translateY(-3px); }
.card__top { height: 120px; position: relative; display: grid; place-items: center; overflow: hidden; }
.card__top svg.glyph { width: 44px; height: 44px; color: #fff; opacity: .95; position: relative; }
.card__top::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(currentColor 1px, transparent 1px); background-size: 13px 13px; color: #fff; }
.g-1 { background: linear-gradient(135deg, #1F6F6B, #3FA396); }
.g-2 { background: linear-gradient(135deg, #2B4C7E, #5A8DC9); }
.g-3 { background: linear-gradient(135deg, #7A4A9E, #B07BD4); }
.g-4 { background: linear-gradient(135deg, #A5661A, #D9A05B); }
.g-5 { background: linear-gradient(135deg, #1D5F52, #4C9E7A); }
.g-6 { background: linear-gradient(135deg, #A33B58, #D4788F); }
.card__body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.chip {
  align-self: flex-start; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: .15rem .45rem; margin-bottom: .7rem;
}
.card h3 { font-size: 1.03rem; margin-bottom: .45rem; }
.card p { font-size: .9rem; color: var(--muted); line-height: 1.55; margin-bottom: 1rem; flex: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.card__tags span { font-size: .74rem; color: var(--muted); background: var(--bg-sunk); border-radius: 5px; padding: .18rem .5rem; }
.card__links { display: flex; gap: .8rem; }
.card__links a {
  font-size: .84rem; font-weight: 500; color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: .3rem;
}
.card__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card__links svg { width: 14px; height: 14px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.contact-list { display: grid; gap: .6rem; margin-bottom: 2rem; }
.contact-list a, .contact-list div {
  display: flex; align-items: center; gap: .95rem; text-decoration: none;
  padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-elev); transition: .18s;
}
.contact-list a:hover { border-color: var(--accent); transform: translateX(3px); }
.ci { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ci svg { width: 17px; height: 17px; }
.cl__k { font-size: .74rem; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.cl__v { font-size: .93rem; color: var(--text); word-break: break-word; }

.form { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .82rem; font-weight: 500; margin-bottom: .4rem; color: var(--text-soft); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .9rem; transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.form-note { font-size: .82rem; color: var(--muted); margin-top: .9rem; }
.form-status { font-size: .9rem; margin-top: .9rem; padding: .7rem .9rem; border-radius: var(--radius-sm); display: none; }
.form-status.ok { display: block; background: var(--accent-soft); color: var(--accent-hi); }
.form-status.err { display: block; background: var(--gold-soft); color: var(--gold); }
html[data-theme="dark"] .form-status.ok { color: var(--accent); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* ---------- CTA banner ---------- */
.cta {
  text-align: center; border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gut); background: var(--bg-elev);
  background-image: radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%);
}
.cta h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: .8rem; }
.cta p { color: var(--muted); max-width: 50ch; margin: 0 auto 1.8rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer p { font-size: .85rem; color: var(--muted); }
.footer a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.footer a:hover { color: var(--accent); }
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 90;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--text); display: grid; place-items: center;
  cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(8px); transition: .22s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Reveal on scroll ----------
   Only hide when JS is present (html.js). Without JS — or if the observer never
   fires — every .reveal stays fully visible, so content is never trapped at opacity 0. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------- Print ---------- */
@media print {
  .header, .to-top, .form, .cta, .social, .hero__cta { display: none !important; }
  body { background: #fff; color: #000; }
  .section { border: none; padding-block: 1.2rem; break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
