/* Jacky Nam portfolio. Theme: Monokai Pro (Filter Sun). */

:root {
  --bg:      #f8efe7;
  --surface: #f2e7dc;
  --line:    #ddd0c2;

  --text:  #2c232e;
  --body:  #55474e;
  --faint: #a59c9c;

  --green:  #218871;
  --orange: #d4572b;
  --yellow: #b16803;
  --red:    #ce4770;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --maxw: 880px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  background: var(--bg);
  color: var(--body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8rem 1.4rem 3rem;
}

::selection { background: var(--green); color: var(--bg); }
img, svg, canvas { display: block; max-width: 100%; }

h1, h2, h3 { color: var(--text); line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1rem;  font-weight: 600; }

p + p { margin-top: 1rem; }
strong { color: var(--text); font-weight: 600; }
em { color: var(--orange); font-style: normal; }

a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover { color: var(--orange); text-decoration-color: var(--orange); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.4rem;
}
.nav__name {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text);
  text-decoration: none;
}
.nav__name:hover { color: var(--orange); }

.intro h1 { margin: 0.9rem 0 1.1rem; }
.intro__hello { display: flex; align-items: center; gap: 0.6rem; }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(33, 136, 113, 0.16);
}

.intro__links {
  margin-top: 2.4rem;
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
}
.nav__links { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.intro__links a,
.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.intro__links a:hover,
.nav__links a:hover { color: var(--orange); border-color: var(--orange); }
.nav__links a.is-here { color: var(--body); border-color: transparent; }

.section {
  margin-top: 3.6rem;
  padding-top: 2.6rem;
  border-top: 1px dashed var(--line);
}
.section--page { margin-top: 0; padding-top: 0; border-top: 0; }
.h-index { color: var(--green); margin-right: 0.55rem; font-size: 0.78rem; }

.tools { margin-top: 1.6rem; font-size: 0.74rem; }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

.forms { margin-top: 2.4rem; display: grid; gap: 1.5rem; }

.cform {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 1.4rem 1.4rem 1.5rem;
  display: grid;
  gap: 0.9rem;
}
.cform__title { color: var(--text); font-size: 1.02rem; }

.cform__field { display: grid; gap: 0.4rem; }
.cform__label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.cform input[type="email"],
.cform textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cform textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.cform input::placeholder,
.cform textarea::placeholder { color: var(--faint); }
.cform input:focus,
.cform textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(33, 136, 113, 0.18);
}

.cform__row { display: flex; gap: 0.8rem; align-items: end; }
.cform__field--grow { flex: 1; }

.btn {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.2s, opacity 0.2s;
}
.btn--primary { background: var(--green); color: var(--bg); }
.btn--primary:hover { background: var(--orange); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.cform__resumebtn { justify-self: start; }

.cform__status { font-size: 0.86rem; min-height: 1.2em; margin: 0; }
.cform__status.is-ok  { color: var(--green); }
.cform__status.is-err { color: var(--red); }

/* honeypot */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0 !important;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}
.or-divider::before, .or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* projects page: embedded deck */

.deck__actions {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.btn--link {
  display: inline-block;
  text-decoration: none;
  color: var(--bg);
}
.btn--link:hover { color: var(--bg); }
.deck__download {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.deck__download:hover { color: var(--orange); border-color: var(--orange); }

.deck {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}
.deck__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(80vh, 760px);
  border: 0;
  background: var(--surface);
}
/* only rendered when the browser refuses to embed the PDF */
.deck__fallback {
  max-width: 46ch;
  padding: 1.4rem;
  margin: 0;
  font-size: 0.94rem;
  text-align: center;
}
.deck__note { margin-top: 0.9rem; font-size: 0.72rem; }

/* projects page: project cards */

.repo-grid {
  margin-top: 1.8rem;
  /* list-style: none strips list semantics in Safari/VoiceOver, so the
     markup carries an explicit role="list" — keep the two together. */
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}
.repo-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.repo-card__name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--green);
  word-break: break-word;
}
.repo-card__desc { font-size: 0.92rem; line-height: 1.6; }
.repo-card__meta {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
}
/* .mono paints text --faint (~2.4:1, below AA); the language label has to be
   readable, so override it here rather than inherit the faint colour. */
.repo-card__meta.mono { color: var(--body); }
.repo-card__lang { display: inline-flex; align-items: center; gap: 0.4rem; }
.lang-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* only --py is used today; the rest are kept so future cards have a palette. */
.lang-dot--c   { background: var(--red); }
.lang-dot--py  { background: var(--yellow); }
.lang-dot--hdl { background: var(--orange); }
.lang-dot--m   { background: var(--green); }

/* projects page: captured terminal output */

.terminal {
  margin-top: 1.2rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-family: var(--font-mono);
  /* JetBrains Mono ligates the captured output's "<->" into one arrow glyph,
     which would misrepresent the real text. */
  font-variant-ligatures: none;
  font-size: 0.74rem;
  line-height: 1.8;
  color: var(--body);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.terminal__prompt { color: var(--green); }
.terminal__cmd  { color: var(--text); font-weight: 500; }
.terminal__fail { color: #b53357; }
.terminal__pass { color: #1b7059; }

@media (max-width: 480px) {
  body { font-size: 0.98rem; }
  h1 { font-size: 1.45rem; }
  .page { padding-top: 3.5rem; }
  .nav__name { font-size: 1.35rem; }
  .cform__row { flex-direction: column; align-items: stretch; }
  .cform__send { width: 100%; }
  .deck__actions { align-items: stretch; flex-direction: column; gap: 0.9rem; }
  .btn--link { text-align: center; }
  .deck__download { align-self: start; }
  .deck__frame { height: min(70vh, 520px); }
  .terminal { padding: 0.9rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
