/* Shared stylesheet for every page of kevinpyo.com.
   The HTML carries the content and structure; this file carries presentation. */

:root {
  --bg: #0A0C10;
  --surface: #11141B;
  --hairline: rgba(232, 234, 240, 0.10);
  --text: #E8EAF0;
  --muted: #7B8493;
  --faint: #767E8B;
  --accent: #5B8CFF;
  --accent-dim: rgba(91, 140, 255, 0.16);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 660px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  /* Set line height to 1.5 times the font size
     and use the OS's UI font as the website font
   */
  font: 100%/1.5 system-ui;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
p { text-wrap: pretty; }

:is(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  display: inline-block;
  margin: 10px 0 0 28px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 3px;
  text-decoration: none;
}

/* ambient lightning layer: signature */
.storm {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, rgba(91, 140, 255, 0.07), transparent 60%);
}
.storm::before,
.storm::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(60% 50% at 28% 0%, rgba(124, 158, 255, 0.22), transparent 55%);
  animation: flash 14s ease-in-out infinite;
}
.storm::after {
  background: radial-gradient(55% 45% at 74% 8%, rgba(150, 130, 255, 0.18), transparent 55%);
  animation-delay: 7.5s;
  animation-duration: 17s;
}
@keyframes flash {
  0%, 100% { opacity: 0; }
  1% { opacity: 0.9; }
  3% { opacity: 0.15; }
  4% { opacity: 0.7; }
  7% { opacity: 0; }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px 120px;
}

/* site navigation: present on every page */
.site-nav {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 28px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.site-nav a:hover { color: var(--text); border-color: var(--hairline); }
.site-nav a[aria-current="page"] { color: var(--text); border-color: rgba(91, 140, 255, 0.42); background: var(--accent-dim); }
.site-nav .spacer { flex: 1 1 auto; }
.hermes-button {
  color: var(--text) !important;
  border-color: rgba(91, 140, 255, 0.48) !important;
  background: rgba(91, 140, 255, 0.07);
}
.hermes-button::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #89aaff;
  box-shadow: 0 0 9px #5B8CFF;
}
.hermes-button:hover { background: var(--accent-dim); border-color: var(--accent) !important; }

/* hero */
.page-head { padding: 72px 0 48px; }
.page-head.home { padding: 80px 0 52px; }

h1 {
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 18px;
  text-wrap: balance;
}

.tagline {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 20px;
  max-width: 48ch;
}
.tagline .sep { color: var(--faint); padding: 0 6px; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: start;
  gap: 28px;
}
.portrait { margin: 0; }
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 3px;
}
.portrait figcaption {
  margin-top: 8px;
  color: var(--faint);
  font: 0.66rem var(--mono);
  line-height: 1.5;
}

nav.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-family: var(--mono);
  font-size: 0.82rem;
}
nav.links a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: 2px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
nav.links a:hover { border-color: var(--accent); color: var(--accent); }

/* lightning readout: signature widget */
.feed {
  margin-top: 30px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.76rem;
  overflow: hidden;
}
.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.feed-head .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.feed-rows { padding: 6px 0; min-height: 86px; }
.feed-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  padding: 3px 14px;
  color: var(--faint);
  white-space: nowrap;
}
.feed-row .t { color: var(--accent); }
.feed-row .c { color: var(--muted); }
.feed-row.new { color: var(--text); }
.feed-note {
  padding: 8px 14px;
  border-top: 1px solid var(--hairline);
  color: var(--faint);
  font-size: 0.7rem;
}

/* sections */
section { padding: 46px 0; border-top: 1px solid var(--hairline); }

.idx {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
h2 {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
  color: var(--text);
}
h3 {
  font-weight: 500;
  font-size: 0.98rem;
  margin: 0;
  color: var(--text);
}

.lede { color: var(--muted); }
.lede p { margin: 0 0 14px; }
.lede p:last-child { margin-bottom: 0; }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li {
  color: var(--muted);
  padding-left: 20px;
  position: relative;
  margin-bottom: 10px;
}
ul.plain li::before {
  content: "\21B3";
  position: absolute;
  left: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.85rem;
}

/* entries (work / projects / resume) */
.entry { margin-bottom: 32px; }
.entry:last-child { margin-bottom: 0; }
.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.entry-title { font-weight: 500; color: var(--text); }
.entry-title a { color: var(--accent); text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }
.entry-date {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  white-space: nowrap;
}
.entry-org { margin: 5px 0 0; color: var(--accent); font-size: 0.86rem; }
.entry-desc { color: var(--muted); margin: 6px 0 0; font-size: 0.95rem; }
.entry-points { margin: 9px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.93rem; }
.entry-points li { margin-bottom: 6px; }
.entry-points li:last-child { margin-bottom: 0; }
.stack {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
}
.stack span {
  color: var(--faint);
  border: 1px solid var(--hairline);
  padding: 2px 7px;
  border-radius: 2px;
}

/* contact form */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 36px;
  align-items: start;
}
form label {
  display: block;
  margin-bottom: 18px;
  color: var(--text);
  font: 500 0.8rem var(--mono);
  letter-spacing: 0.02em;
}
input, textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font: 400 0.95rem/1.5 system-ui;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover { border-color: rgba(91, 140, 255, 0.4); }
textarea { min-height: 148px; resize: vertical; }
button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--text);
  cursor: pointer;
  font: 500 0.82rem var(--mono);
  transition: background 0.18s ease;
}
button:hover { background: rgba(91, 140, 255, 0.3); }
.form-note { margin: 14px 0 0; color: var(--faint); font-size: 0.8rem; line-height: 1.6; }

footer {
  border-top: 1px solid var(--hairline);
  padding-top: 28px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.76rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Hermes dashboard (home only) */
#hermes { scroll-margin-top: 22px; }
.hermes-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.hermes-topline h2 { margin-bottom: 5px; }
.hermes-subtitle { margin: 0; color: var(--muted); font-size: 0.9rem; }
.agent-state {
  flex: 0 0 auto;
  font: 500 0.7rem var(--mono);
  color: var(--muted);
  border: 1px solid var(--hairline);
  padding: 5px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.agent-state .state-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--faint); }
.agent-state.active { color: #9db7ff; border-color: rgba(91, 140, 255, 0.42); }
.agent-state.active .state-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s ease-in-out infinite; }
.agent-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--hairline); border-radius: 3px; background: var(--surface); }
.summary-item { padding: 14px; border-right: 1px solid var(--hairline); }
.summary-item:last-child { border-right: 0; }
.summary-value { display: block; color: var(--text); font: 500 1.15rem var(--mono); line-height: 1.2; }
.summary-label { display: block; margin-top: 5px; color: var(--faint); font: 0.66rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.agent-tabs { display: flex; align-items: center; gap: 3px; margin-top: 12px; padding: 4px; border: 1px solid var(--hairline); border-bottom: 0; background: var(--surface); border-radius: 3px 3px 0 0; }
.agent-tab {
  appearance: none;
  border: 0;
  min-height: 0;
  border-radius: 2px;
  padding: 7px 10px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: 0.72rem var(--mono);
  transition: color 0.18s ease, background 0.18s ease;
}
.agent-tab:hover { color: var(--text); background: transparent; }
.agent-tab[aria-selected="true"] { color: var(--text); background: var(--accent-dim); }
.tab-count { color: var(--accent); margin-left: 4px; }
.dash-card { border: 1px solid var(--hairline); border-radius: 3px; background: var(--surface); overflow: hidden; }
.agent-panel { min-height: 228px; border-radius: 0 0 3px 3px; }
.agent-panel[hidden] { display: none; }
.agent-list { padding: 5px 0; }
.agent-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
.agent-row:last-child { border-bottom: 0; }
.agent-row-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.agent-row-dot.working { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2s ease-in-out infinite; }
.agent-row-dot.blocked, .agent-row-dot.error { background: #e09372; }
.agent-copy { min-width: 0; }
.agent-title { display: block; overflow: hidden; color: var(--text); font-size: 0.82rem; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.agent-detail { display: block; overflow: hidden; margin-top: 3px; color: var(--faint); font: 0.68rem var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.agent-meta { text-align: right; }
.agent-status { display: block; color: var(--muted); font: 0.66rem var(--mono); text-transform: uppercase; }
.agent-time { display: block; margin-top: 4px; color: var(--faint); font: 0.65rem var(--mono); }
.activity-empty { padding: 32px 14px; color: var(--faint); font: 0.76rem var(--mono); text-align: center; }
.dashboard-note { margin: 11px 0 0; color: var(--faint); font: 0.7rem var(--mono); }

@media (max-width: 620px) {
  .contact-grid { grid-template-columns: 1fr; gap: 26px; }
  .intro { grid-template-columns: 1fr; gap: 22px; }
  .portrait { max-width: 124px; }
}

@media (max-width: 520px) {
  .site-nav { padding-top: 14px; }
  .site-nav .spacer { flex-basis: 100%; height: 0; }
  .page-head, .page-head.home { padding: 44px 0 36px; }
  section { padding: 36px 0; }
  .feed-row { grid-template-columns: 56px 1fr; }
  .feed-row .c { display: none; }
  .agent-summary { grid-template-columns: repeat(2, 1fr); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .hermes-topline { display: block; }
  .agent-state { display: inline-block; margin-top: 12px; }
  .agent-tabs { overflow-x: auto; }
  .agent-row { grid-template-columns: 9px minmax(0, 1fr); }
  .agent-meta { grid-column: 2; display: flex; gap: 8px; text-align: left; }
  .agent-status, .agent-time { display: inline; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .storm::before, .storm::after, .feed-head .dot, .agent-row-dot.working, .agent-state.active .state-dot { animation: none; }
  .storm::before { opacity: 0.12; }
  html { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; color: #000; }
  .storm, .site-nav, .feed, #hermes, .skip-link { display: none; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: underline; }
}
