/* ==========================================================================
   hewage.io — dark terminal design system
   One stylesheet, no frameworks. Tokens at :root; everything else composes them.
   ========================================================================== */

:root {
  --bg:        #0d1117;
  --bg-soft:   #161b22;
  --bg-hover:  #1c2230;
  --fg:        #e6edf3;
  --muted:     #8b949e;
  --accent:    #3fb950;   /* terminal green */
  --accent-dim:#2ea043;
  --link:      #58a6ff;
  --border:    #30363d;

  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  --maxw: 72ch;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --radius: 6px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: clamp(15px, 0.6vw + 13.5px, 17px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding: 0; }

.muted { color: var(--muted); }
.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--bg); padding: .5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------- layout shell ---------- */
.site-header, .site-main, .site-footer {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: var(--gap);
}
.site-main { padding-block: clamp(2rem, 6vw, 4rem); min-height: 60vh; }

/* ---------- nav ---------- */
.site-header { border-bottom: 1px solid var(--border); }
.nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
  padding-block: 1rem;
}
.nav-brand { color: var(--fg); font-weight: 700; margin-right: auto; }
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin: 0; }
.nav-links a { color: var(--muted); }
.nav-links a::before { content: ""; color: var(--accent); margin-right: .15rem; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-links a:hover::before { content: "/"; }
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-links a[aria-current="page"]::before { content: "/"; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--border); }
.prompt { color: var(--muted); margin: 0 0 .5rem; }
.hero-title {
  font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.1; margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.cursor {
  display: inline-block; width: .6ch; height: 1.05em; margin-left: .15ch;
  background: var(--accent); transform: translateY(.12em);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-lead { font-size: clamp(1rem, 1.5vw, 1.2rem); max-width: var(--maxw); color: var(--fg); }
.hero-lead strong { color: var(--accent); font-weight: 700; }
.hero-status { color: var(--muted); max-width: var(--maxw); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: .5rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--fg); background: var(--bg-soft);
  font: inherit; cursor: pointer; transition: all .15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #0d1117; font-weight: 700; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #0d1117; }

/* ---------- section labels ---------- */
.section-label {
  font-size: 1rem; color: var(--muted); font-weight: 400;
  margin: clamp(2rem, 5vw, 3rem) 0 1rem; border-bottom: 1px dashed var(--border);
  padding-bottom: .5rem;
}

/* ---------- home grid ---------- */
.home-grid {
  display: grid; gap: 1rem; margin-top: clamp(2rem, 5vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.card-link {
  display: block; padding: 1.25rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-soft); color: var(--fg);
  transition: border-color .15s ease, transform .15s ease;
}
.card-link:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.card-title { margin: 0 0 .5rem; font-size: 1.15rem; color: var(--accent); }
.card-link p { margin: 0; color: var(--muted); font-size: .92rem; }
.arrow { transition: transform .15s ease; display: inline-block; }
.card-link:hover .arrow { transform: translateX(.25rem); }

/* ---------- project list ---------- */
.project-list { list-style: none; margin: 0; display: grid; gap: 1rem; }
.project {
  padding: 1rem 1.25rem; border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: var(--bg-soft);
}
.project-name { font-weight: 700; font-size: 1.05rem; }
.project-blurb { margin: .4rem 0 .6rem; color: var(--fg); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.tags li {
  font-size: .75rem; color: var(--muted); padding: .15rem .55rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg);
}

/* ---------- generic pages ---------- */
.page-head { margin-bottom: 2rem; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 .25rem; }
.page-subtitle { color: var(--muted); margin: 0; max-width: var(--maxw); }
.page p, .page li { max-width: var(--maxw); }

/* ---------- timeline (work) ---------- */
.timeline { list-style: none; margin: 0; border-left: 2px solid var(--border); }
.tl-entry { position: relative; padding: 0 0 2rem 1.5rem; }
.tl-entry::before {
  content: ""; position: absolute; left: -7px; top: .55rem; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px var(--bg);
}
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.tl-role { font-weight: 700; font-size: 1.1rem; }
.tl-org { color: var(--accent); }
.tl-dates { color: var(--muted); font-size: .85rem; margin-left: auto; }
.tl-loc { color: var(--muted); font-size: .85rem; margin: .1rem 0 .5rem; }
.tl-summary { margin: .25rem 0 .5rem; }
.tl-points { margin: .5rem 0; padding-left: 1.1rem; }
.tl-points li { margin-bottom: .35rem; }

/* ---------- publications ---------- */
.pub-list { list-style: none; margin: 0; display: grid; gap: 1.25rem; }
.pub {
  padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft);
}
.pub-title-main { font-weight: 700; display: block; margin: .15rem 0 .35rem; }
.pub-authors { color: var(--muted); font-size: .9rem; }
.pub-authors strong { color: var(--fg); }
.pub-venue { color: var(--muted); font-size: .85rem; }
.pub-links { margin-top: .6rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.pub-links a, .pub-status {
  font-size: .75rem; padding: .2rem .6rem; border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pub-status { color: var(--muted); }

/* ---------- resume ---------- */
.resume { max-width: 52rem; }
.resume-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.resume-name { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0; }
.resume-tagline { color: var(--muted); margin: .15rem 0 0; }
.resume-contact { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1rem 0 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.resume-section { margin-bottom: 2rem; }
.resume-h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: .35rem; margin-bottom: 1rem; }
.resume-entry { margin-bottom: 1.25rem; }
.resume-entry-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.resume-role { font-weight: 700; }
.resume-dates { color: var(--muted); font-size: .85rem; margin-left: auto; }
.resume-loc { color: var(--muted); font-size: .85rem; margin: .1rem 0 .4rem; }
.resume-points { margin: .4rem 0; padding-left: 1.1rem; }
.resume-points li { margin-bottom: .3rem; }
.resume-skills { margin: 0; display: grid; gap: .5rem; }
.resume-skills > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; }
.resume-skills dt { font-weight: 700; color: var(--muted); margin: 0; }
.resume-skills dd { margin: 0; }
.resume-pubs { list-style: none; margin: 0; display: grid; gap: .75rem; padding: 0; }
.resume-pubs .pub-title { font-style: italic; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; margin-top: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.footer-meta { color: var(--muted); font-size: .8rem; margin: 1rem 0 0; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: clamp(2rem, 10vw, 6rem); }
.notfound h1 { font-size: clamp(3rem, 12vw, 6rem); margin: 0; color: var(--accent); }

/* ---------- accessibility / motion ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .cursor { opacity: 1; }
}

/* ---------- responsive ---------- */
@media (max-width: 38rem) {
  .resume-skills > div { grid-template-columns: 1fr; gap: .1rem; }
  .tl-dates, .resume-dates { margin-left: 0; }
}

/* ---------- print (resume → PDF) ---------- */
@media print {
  :root { --bg:#fff; --bg-soft:#fff; --fg:#111; --muted:#555; --accent:#000; --link:#000; --border:#ccc; }
  body { font-size: 11pt; line-height: 1.4; }
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  .site-main { padding: 0; max-width: 100%; }
  .resume { max-width: 100%; }
  .resume-h2 { color: #000; }
  a { color: #000; text-decoration: none; }
  .resume-section { margin-bottom: 1rem; break-inside: avoid; }
  .resume-entry { break-inside: avoid; }
}
