/* ===========================================================
   418.rs — studio portfolio
   Theme variables: ink (dark, default) + paper (light)
   =========================================================== */

:root,
[data-theme="ink"] {
  --bg:     #0A0A0A;
  --panel:  #131313;
  --panel2: #171717;
  --line:   #262626;
  --ink:    #FAFAF7;
  --muted:  #8A8A8A;
  --accent: #14B89B;
}

[data-theme="paper"] {
  --bg:     #FAFAF7;
  --panel:  #FFFFFF;
  --panel2: #F4F2EB;
  --line:   #ECEAE0;
  --ink:    #0A0A0A;
  --muted:  #6B6B63;
  --accent: #14B89B;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

.app { min-height: 100vh; }

.wrap { max-width: 1080px; margin: 0 auto; }

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

a { color: var(--accent); }
a:hover { color: var(--ink); }

::selection { background: #14B89B; color: #0A0A0A; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-decoration: none;
}
.brand__mark {
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .02em;
  color: var(--ink);
}
.brand__sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: .02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
}
.nav__link {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.nav__link:hover { color: var(--ink); }

.theme-toggle {
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 24px 76px;
}

.req-line {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 30px;
}

.teapot {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  line-height: .9;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: clamp(66px, 14vw, 188px);
  letter-spacing: .01em;
}
.teapot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
  border-radius: 8px;
}

.steam {
  position: absolute;
  left: 6%;
  bottom: 100%;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  pointer-events: none;
}
.steam span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  animation: steam 2.4s ease-in-out infinite;
}
.steam span:nth-child(2) { animation-delay: .4s; }
.steam span:nth-child(3) { animation-delay: .8s; }

.tagline {
  margin-top: 20px;
  font-size: clamp(18px, 3vw, 30px);
  color: var(--muted);
  font-weight: 500;
}
.caret {
  display: inline-block;
  width: .6ch;
  margin-left: .15ch;
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.hero__headline {
  font-weight: 700;
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.15;
  max-width: 16ch;
  margin: 30px 0 0;
  letter-spacing: -.01em;
}

.hero__lede {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted);
  max-width: 54ch;
  margin: 20px 0 0;
  font-size: 15.5px;
  line-height: 1.65;
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.btn {
  padding: 13px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
}
.btn--solid {
  background: var(--accent);
  color: #0A0A0A;
  font-weight: 600;
  transition: filter .2s;
}
.btn--solid:hover { filter: brightness(1.08); color: #0A0A0A; }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color .2s;
}
.btn--ghost:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- Terminal cards ---------- */
.terminal {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.hero__terminal { margin-top: 58px; max-width: 580px; }

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .35;
}
.terminal__title {
  margin-left: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.terminal__body {
  margin: 0;
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', monospace;
}
.terminal__body a { color: var(--ink); text-decoration: none; }
.terminal__body a:hover { color: var(--accent); }

/* ---------- Sections ---------- */
.section {
  padding: 44px 24px 24px;
  border-top: 1px solid var(--line);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.req-verb { font-size: 13px; color: var(--muted); }
.req-status { font-size: 13px; }
.section__title {
  font-weight: 700;
  font-size: clamp(30px, 5vw, 52px);
  margin: 0;
  letter-spacing: -.01em;
}

/* ---------- Work / projects ---------- */
.projects { display: grid; gap: 22px; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
}
.project__info {
  padding: 30px;
  display: flex;
  flex-direction: column;
}
.project__route { font-size: 12.5px; color: var(--muted); }
.project__num { font-size: 12.5px; color: var(--accent); margin-top: 26px; }
.project__name {
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 38px);
  margin: 5px 0 0;
  letter-spacing: -.01em;
}
.project__blurb {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 13px 0 22px;
  max-width: 40ch;
}
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  margin-bottom: 22px;
}
.tag {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}
.project__link {
  align-self: flex-start;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  transition: color .2s;
}
.project__link:hover { color: var(--accent); }

.project__shot {
  position: relative;
  min-height: 290px;
  background: var(--panel2);
  border-left: 1px solid var(--line);
}
.shot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 12.5px;
  color: var(--muted);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .9;
}
.project__shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- About ---------- */
.about { padding: 84px 24px; }
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 48px;
}
.about__body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.72;
}
.about__body p { margin: 0 0 18px; }
.about__body p:last-of-type { margin: 0; }
.about__body strong { font-weight: 700; }

.stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  font-family: 'JetBrains Mono', monospace;
}
.stat__num { font-weight: 700; font-size: 30px; }
.stat__label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Contact ---------- */
.contact { padding: 84px 24px 100px; }
.contact__lede {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted);
  max-width: 48ch;
  margin: 16px 0 34px;
  font-size: 15.5px;
  line-height: 1.6;
}
.contact__terminal { max-width: 660px; }
.contact__terminal .terminal__body { font-size: 13px; line-height: 2; padding: 18px; }
.contact__action { padding: 0 18px 18px; }
.contact__action .btn { display: inline-block; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Reveal-on-scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Animations ---------- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes steam {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-6px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .project { grid-template-columns: 1fr; }
  .project__shot { min-height: 220px; border-left: none; border-top: 1px solid var(--line); }
  .about__grid { grid-template-columns: 1fr; gap: 28px; }
  .nav { gap: 16px; }
}

@media (max-width: 480px) {
  .nav__link { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .steam span, .caret { animation: none; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
}
