/* ============================================================
   jyooi.com — terminal theme
   ink + phosphor + amber. mono-first. crt-flavored, restrained.
   ============================================================ */

:root {
  /* palette */
  --ink:         #0c0d0c;
  --ink-2:       #111210;
  --ink-3:       #16170f;
  --cream:       #e8e2d0;
  --cream-dim:   #b8b3a4;
  --gray:        #6e6a5e;
  --gray-dim:    #3a3830;
  --rule:        #23241f;
  --amber:       #ffb84d;
  --amber-dim:   #c98d2f;
  --red:         #ff5b5b;
  --green:       #7dc97a;
  --blue:        #6db2d6;

  /* type */
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --serif: 'IBM Plex Serif', Georgia, serif;

  /* scale */
  --line: 1.55;
  --measure: 78ch;
  --gap: clamp(1rem, 2.5vw, 1.75rem);

  /* type sizes — kept tight, mono only */
  --fs-mini: 0.72rem;
  --fs-xs:   0.81rem;
  --fs-s:    0.9rem;
  --fs-base: 0.95rem;
  --fs-m:    1.05rem;
  --fs-l:    1.35rem;
  --fs-xl:   2rem;
  --fs-xxl:  clamp(2.6rem, 6vw, 4.4rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: var(--fs-base);
  line-height: var(--line);
  font-feature-settings: "ss01", "ss02", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse 90% 60% at 50% -20%, rgba(255, 184, 77, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 110%, rgba(255, 91, 91, 0.04), transparent 70%),
    var(--ink);
}

::selection { background: var(--amber); color: var(--ink); }

/* ------------------------------------------------------------
   CRT layer: scanlines + soft grain. low opacity, never noisy.
   ------------------------------------------------------------ */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0,
    rgba(255, 255, 255, 0.022) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3%, -2%); }
  30% { transform: translate(2%, -4%); }
  50% { transform: translate(-1%, 3%); }
  70% { transform: translate(3%, 1%); }
  90% { transform: translate(-2%, -1%); }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}

/* ------------------------------------------------------------
   Screen: outermost frame mimicking a terminal window pane.
   ------------------------------------------------------------ */
.screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(0.75rem, 2vw, 1.5rem) clamp(0.75rem, 3vw, 2rem) 2rem;
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   Topbar (window chrome + path + clock)
   ------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 6px 6px 0 0;
  font-size: var(--fs-xs);
}

.topbar__chrome {
  display: inline-flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.dot--red    { background: #ff605c; }
.dot--amber  { background: #ffbd44; }
.dot--green  { background: #00ca4e; }

.topbar__title {
  flex: 1;
  color: var(--cream-dim);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__user  { color: var(--amber); }
.topbar__host  { color: var(--green); }
.topbar__sep   { color: var(--gray); }
.topbar__path  { color: var(--blue); }

.topbar__clock {
  color: var(--amber-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   Navbar: keyboard-hint style links
   ------------------------------------------------------------ */
.navbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-top: none;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  font-size: var(--fs-s);
}

.nav-link {
  color: var(--cream-dim);
  text-decoration: none;
  position: relative;
  padding: 0.15rem 0;
  transition: color 0.15s ease;
}
.nav-link__key {
  color: var(--amber);
  margin-right: 0.35rem;
  font-weight: 500;
}
.nav-link__ext {
  color: var(--gray);
  margin-left: 0.2rem;
  font-size: 0.85em;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--amber);
  outline: none;
}
.nav-link:hover::after,
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.35rem;
  height: 1px;
  background: var(--amber);
}
.nav-link.is-active { color: var(--cream); }

/* ------------------------------------------------------------
   Content
   ------------------------------------------------------------ */
.content {
  border: 1px solid var(--rule);
  border-top: none;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2.5rem);
  background:
    linear-gradient(180deg, rgba(255, 184, 77, 0.012), transparent 30%),
    var(--ink);
  border-radius: 0 0 6px 6px;
  min-height: 70vh;
}

/* ------------------------------------------------------------
   Section primitives: section header, prompt lines
   ------------------------------------------------------------ */
.section {
  margin: 3.5rem 0;
  scroll-margin-top: 6rem;
}
.section:first-of-type { margin-top: 1rem; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  font-size: var(--fs-s);
  color: var(--cream-dim);
}
.section__prompt { color: var(--amber); }
.section__cmd    { color: var(--cream); font-weight: 500; }
.section__hint   { color: var(--gray); font-size: var(--fs-xs); margin-left: auto; }

.section__rule {
  font-family: var(--mono);
  color: var(--gray-dim);
  letter-spacing: -0.02em;
  font-size: var(--fs-xs);
  margin: 0 0 1.5rem;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  margin-top: 1rem;
  position: relative;
}

.hero__shell {
  font-size: var(--fs-s);
  color: var(--cream-dim);
  margin-bottom: 1.5rem;
}
.hero__shell .prompt { color: var(--amber); }
.hero__shell .cmd    { color: var(--cream); }

.hero__name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-xxl);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0.5rem 0 0;
  color: var(--cream);
  position: relative;
}
.hero__name .accent { color: var(--amber); }
.hero__name .punct  { color: var(--red); }

.hero__role {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--cream-dim);
  margin: 1.1rem 0 0;
  max-width: 56ch;
}

.hero__meta {
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  font-size: var(--fs-xs);
  color: var(--gray);
}
.hero__meta .k { color: var(--amber-dim); }
.hero__meta .v { color: var(--cream-dim); }

.hero__bio {
  margin: 2rem 0 0;
  max-width: 64ch;
  color: var(--cream-dim);
  font-size: var(--fs-m);
  line-height: 1.65;
}
.hero__bio strong { color: var(--cream); font-weight: 500; }
.hero__bio em { font-family: var(--serif); font-style: italic; color: var(--amber); }

.hero__cta {
  margin: 1.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rule);
  color: var(--cream);
  text-decoration: none;
  font-size: var(--fs-s);
  background: var(--ink-2);
  transition: all 0.18s ease;
  cursor: pointer;
}
.btn::before { content: "$"; color: var(--amber); margin-right: 0.15rem; }
.btn:hover, .btn:focus-visible {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(255, 184, 77, 0.06);
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: 1px 1px 0 var(--amber);
}
.btn--primary {
  border-color: var(--amber);
  color: var(--amber);
}
.btn--primary:hover {
  background: var(--amber);
  color: var(--ink);
}
.btn--primary:hover::before { color: var(--ink); }

/* blinking cursor */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--amber);
  vertical-align: -0.12em;
  margin-left: 0.18em;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
}

/* ------------------------------------------------------------
   Experience timeline
   ------------------------------------------------------------ */
.exp {
  display: grid;
  gap: 0;
}
.exp__row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.2rem;
  padding: 1.1rem 0;
  border-top: 1px dashed var(--rule);
  align-items: baseline;
}
.exp__row:first-child { border-top: none; padding-top: 0.25rem; }
.exp__date {
  color: var(--amber-dim);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.exp__date .arrow { color: var(--gray); }
.exp__body {
  display: grid;
  gap: 0.35rem;
}
.exp__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.7rem;
}
.exp__company {
  color: var(--cream);
  font-weight: 600;
  font-size: var(--fs-m);
}
.exp__role {
  color: var(--cream-dim);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-s);
}
.exp__loc {
  color: var(--gray);
  font-size: var(--fs-xs);
  margin-left: auto;
}
.exp__desc {
  color: var(--cream-dim);
  font-size: var(--fs-s);
  max-width: 70ch;
  margin: 0.25rem 0 0;
}
.exp__stack {
  margin: 0.5rem 0 0;
  font-size: var(--fs-xs);
  color: var(--gray);
}
.exp__stack .tag {
  display: inline-block;
  margin-right: 0.65rem;
  color: var(--cream-dim);
}
.exp__stack .tag::before {
  content: "·";
  color: var(--gray-dim);
  margin-right: 0.5rem;
}
.exp__stack .tag:first-child::before { content: ""; margin: 0; }

/* ------------------------------------------------------------
   Projects
   ------------------------------------------------------------ */
.projects {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.project {
  border: 1px solid var(--rule);
  padding: 1.25rem 1.4rem 1.1rem;
  background: var(--ink-2);
  position: relative;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.project:hover {
  border-color: var(--amber);
  transform: translate(-1px, -1px);
  box-shadow: 1px 1px 0 var(--gray-dim);
}
.project__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.project__no {
  color: var(--gray);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.project__title {
  font-size: var(--fs-l);
  color: var(--cream);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.project__title a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--amber), var(--amber));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s ease;
}
.project__title a:hover { background-size: 100% 1px; color: var(--amber); }
.project__status {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.project__status .pulse {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--amber);
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: 0.1em;
  animation: pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 8px var(--amber);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}

.project__desc {
  color: var(--cream-dim);
  font-size: var(--fs-s);
  margin: 0.4rem 0 0.6rem;
  max-width: 68ch;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: var(--fs-xs);
  margin-top: 0.4rem;
}
.project__links a {
  color: var(--cream-dim);
  text-decoration: none;
  border-bottom: 1px dashed var(--gray-dim);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.project__links a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
  border-bottom-style: solid;
}
.project__links a::before {
  content: "→";
  color: var(--amber);
  margin-right: 0.3rem;
}

/* ------------------------------------------------------------
   Skills (one-line grid)
   ------------------------------------------------------------ */
.skills {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.4rem 1.2rem;
  font-size: var(--fs-s);
  margin-top: 0.5rem;
}
.skills__k {
  color: var(--amber-dim);
  font-variant-numeric: tabular-nums;
}
.skills__v {
  color: var(--cream-dim);
}
.skills__v .sep { color: var(--gray-dim); margin: 0 0.4rem; }

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.contact {
  display: grid;
  gap: 0.5rem;
  font-size: var(--fs-s);
  max-width: 68ch;
}
.contact__row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  align-items: baseline;
}
.contact__k {
  color: var(--amber-dim);
}
.contact__v a {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-dim);
  padding-bottom: 1px;
}
.contact__v a:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  margin-top: 3rem;
  padding: 0 0.25rem;
  font-size: var(--fs-xs);
  color: var(--gray);
}
.footer-rule {
  color: var(--gray-dim);
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--mono);
}
.site-footer__row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 0.6rem 0.4rem 0;
}
.dim { color: var(--gray); }

/* ------------------------------------------------------------
   Single-page (project detail)
   ------------------------------------------------------------ */
.single {
  max-width: var(--measure);
}
.single__back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--cream-dim);
  font-size: var(--fs-xs);
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.single__back::before { content: "←"; color: var(--amber); }
.single__back:hover { color: var(--amber); }

.single__title {
  font-size: var(--fs-xl);
  margin: 0 0 0.4rem;
  color: var(--cream);
  letter-spacing: -0.02em;
}
.single__meta {
  font-size: var(--fs-xs);
  color: var(--gray);
  margin: 0 0 2rem;
}

.single article {
  color: var(--cream-dim);
  font-size: var(--fs-m);
  line-height: 1.7;
}
.single article h1, .single article h2, .single article h3 {
  color: var(--cream);
  font-family: var(--mono);
  letter-spacing: -0.01em;
  margin-top: 2.2rem;
}
.single article h3 { font-size: var(--fs-l); }
.single article h3::before { content: "## "; color: var(--amber); }

.single article a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px dashed var(--amber-dim);
}
.single article a:hover { border-bottom-style: solid; }

.single article code {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 0.05rem 0.35rem;
  font-size: 0.92em;
  color: var(--amber);
}
.single article pre {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 1rem;
  overflow-x: auto;
  font-size: var(--fs-s);
}
.single article img {
  max-width: 100%;
  border: 1px solid var(--rule);
  margin: 1.5rem 0;
}
.single article blockquote {
  border-left: 2px solid var(--amber);
  margin: 1.5rem 0;
  padding-left: 1rem;
  color: var(--cream-dim);
  font-family: var(--serif);
  font-style: italic;
}

/* ------------------------------------------------------------
   Boot animation: progressive reveal of hero lines.
   ------------------------------------------------------------ */
[data-page="home"] .boot {
  opacity: 0;
  transform: translateY(0.4rem);
  animation: bootIn 0.5s ease forwards;
}
@keyframes bootIn {
  to { opacity: 1; transform: translateY(0); }
}
[data-page="home"] .boot:nth-child(1) { animation-delay: 0.05s; }
[data-page="home"] .boot:nth-child(2) { animation-delay: 0.20s; }
[data-page="home"] .boot:nth-child(3) { animation-delay: 0.35s; }
[data-page="home"] .boot:nth-child(4) { animation-delay: 0.50s; }
[data-page="home"] .boot:nth-child(5) { animation-delay: 0.70s; }
[data-page="home"] .boot:nth-child(6) { animation-delay: 0.90s; }
[data-page="home"] .boot:nth-child(7) { animation-delay: 1.10s; }
[data-page="home"] .boot:nth-child(8) { animation-delay: 1.30s; }

@media (prefers-reduced-motion: reduce) {
  [data-page="home"] .boot { animation: none; opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 700px) {
  :root { --fs-base: 0.92rem; }
  .exp__row,
  .skills,
  .contact__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .exp__date { font-size: var(--fs-mini); color: var(--amber); }
  .skills__k, .contact__k { color: var(--amber); font-size: var(--fs-xs); }
  .topbar__title { font-size: var(--fs-mini); }
  .topbar__clock { display: none; }
  .navbar { gap: 0 1rem; font-size: var(--fs-xs); }
  .nav-link__key { display: none; }
  .footer-rule { font-size: 0.55rem; }
}
