/* ============================================================================
   shipramen — portfolio system
   craft-terminal × editorial typesetting
   ----------------------------------------------------------------------------
   TYPE     JetBrains Mono (signature: nav, labels, tags, meta, the mark)
            Newsreader (reading: headlines + body)  ·  Archivo (grotesque alt)
   COLOR    light-primary editorial · near-black warm ink on warm off-white
            one accent: editorial red (broth / exploit / ship)
   ========================================================================== */

/* ---- tokens : light (signature surface) --------------------------------- */
:root {
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --grotesque: 'Archivo', system-ui, -apple-system, sans-serif;
  --reading: var(--serif);

  --bg:      oklch(0.967 0.008 79);
  --bg-2:    oklch(0.945 0.011 78);
  --bg-sink: oklch(0.928 0.013 78);
  --ink:     oklch(0.235 0.012 55);
  --ink-2:   oklch(0.435 0.012 58);
  --ink-3:   oklch(0.585 0.011 62);
  --line:    oklch(0.872 0.011 72);
  --line-2:  oklch(0.808 0.013 70);

  --accent:     oklch(0.545 0.182 27);
  --accent-ink: oklch(0.495 0.188 27);
  --accent-wash: color-mix(in oklch, var(--accent) 9%, transparent);

  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 80px);
  --rule: 1px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:      oklch(0.183 0.008 64);
  --bg-2:    oklch(0.218 0.010 64);
  --bg-sink: oklch(0.158 0.008 64);
  --ink:     oklch(0.918 0.008 82);
  --ink-2:   oklch(0.742 0.010 78);
  --ink-3:   oklch(0.585 0.011 72);
  --line:    oklch(0.305 0.012 66);
  --line-2:  oklch(0.372 0.014 66);

  --accent:     oklch(0.665 0.168 30);
  --accent-ink: oklch(0.720 0.158 32);
  --accent-wash: color-mix(in oklch, var(--accent) 14%, transparent);

  color-scheme: dark;
}

[data-font="grotesque"] { --reading: var(--grotesque); }

/* ---- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--reading);
  font-size: 18px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--bg); }

/* ---- mono primitives ---------------------------------------------------- */
.mono {
  font-family: var(--mono);
  font-feature-settings: "ss02" 1, "cv01" 1;
}
.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-3);
}
.label--accent { color: var(--accent-ink); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.eyebrow .num { color: var(--accent-ink); }

/* ---- layout scaffold ---------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* editorial two-column: system label gutter + content */
.row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 64px);
}
.row__label { padding-top: 6px; }
/* let grid items shrink below content min-content so children (terminal) can scroll internally instead of overflowing the page */
.row > * { min-width: 0; }
.section {
  border-top: var(--rule) solid var(--line);
  padding-block: clamp(48px, 7vw, 96px);
}

@media (max-width: 760px) {
  .row { grid-template-columns: 1fr; gap: 18px; }
}

/* ---- nav ---------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: var(--rule) solid var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.mark .dot { transform: translateY(0.5px); }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
}
.nav__link {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  transition: color .18s ease;
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--accent-ink); }
.nav__link[aria-current="page"]::before { content: "› "; color: var(--accent-ink); }

.themebtn {
  appearance: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: var(--rule) solid var(--line-2);
  border-radius: 7px;
  padding: 6px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.themebtn:hover { border-color: var(--ink-3); color: var(--ink); }
.themebtn .glyph {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}
@media (max-width: 680px) {
  .nav__links .nav__link:not(.nav__link--keep) { display: none; }
}

/* ---- status dots -------------------------------------------------------- */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot--live {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
@media (prefers-reduced-motion: no-preference) {
  .dot--live { animation: pulse 2.6s ease-in-out infinite; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-wash); }
  50%      { box-shadow: 0 0 0 5px color-mix(in oklch, var(--accent) 4%, transparent); }
}
.dot--beta  { background: var(--ink-2); }
.dot--alpha { background: transparent; border: 1.5px solid var(--ink-3); width: 8px; height: 8px; }
.dot--none  { background: transparent; border: 1.5px dashed var(--line-2); width: 8px; height: 8px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* ---- version tag -------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  border: var(--rule) solid var(--line-2);
  border-radius: 5px;
  padding: 2px 7px;
}
.note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.note::before { content: "// "; opacity: 0.7; }

/* ---- hero --------------------------------------------------------------- */
.hero { padding-block: clamp(56px, 11vh, 132px) clamp(40px, 7vw, 84px); }
.hero__eyebrow { margin-bottom: clamp(28px, 5vw, 52px); }
.hero h1 {
  font-family: var(--reading);
  font-weight: 560;
  font-size: clamp(2.7rem, 6.4vw, 5.3rem);
  line-height: 0.99;
  letter-spacing: -0.022em;
  text-wrap: balance;
  max-width: 18ch;
}
.hero h1 .soft { color: var(--ink-3); font-weight: 400; }
.hero h1 em {
  font-style: italic;
  color: var(--accent-ink);
}
.hero__sub {
  margin-top: clamp(22px, 3vw, 34px);
  max-width: 52ch;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  color: var(--ink-2);
  line-height: 1.55;
  text-wrap: pretty;
}
.hero__meta {
  margin-top: clamp(30px, 4vw, 46px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-top: 18px;
  border-top: var(--rule) solid var(--line);
}

/* terminal prompt — the single permitted motion flourish */
.prompt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}
.prompt .sig { color: var(--accent-ink); }
.prompt .path { color: var(--ink-3); }
.caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 3px;
  background: var(--accent);
  transform: translateY(2px);
}
@media (prefers-reduced-motion: no-preference) {
  .caret { animation: blink 1.1s steps(1) infinite; }
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ---- section heading ---------------------------------------------------- */
.shead { display: flex; flex-direction: column; gap: 14px; }
.shead h2 {
  font-family: var(--reading);
  font-weight: 540;
  font-size: clamp(1.7rem, 3.1vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.018em;
  max-width: 20ch;
}
.shead p {
  max-width: 46ch;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.lede { font-size: clamp(1.12rem, 1.7vw, 1.38rem); line-height: 1.5; color: var(--ink); max-width: 40ch; }

/* ---- collection list (tool cards) --------------------------------------- */
.collection { display: flex; flex-direction: column; }
.toolcard {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  padding: clamp(26px, 3.4vw, 38px) 0;
  border-top: var(--rule) solid var(--line);
  transition: opacity .25s ease;
}
.toolcard:last-child { border-bottom: var(--rule) solid var(--line); }
a.toolcard { color: inherit; }
a.toolcard::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--gutter)/2);
  right: calc(-1 * var(--gutter)/2);
  top: -1px; bottom: 0;
  border-radius: 10px;
  background: var(--accent-wash);
  opacity: 0;
  transition: opacity .22s ease;
  z-index: -1;
}
a.toolcard:hover::after { opacity: 1; }
.toolcard__idx {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  padding-top: 9px;
}
.toolcard__main { min-width: 0; }
.toolcard__name {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.toolcard__name h3 {
  font-family: var(--mono);
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
a.toolcard:hover .toolcard__name h3 { color: var(--accent-ink); }
.toolcard__pitch {
  margin-top: 12px;
  font-size: clamp(1.06rem, 1.5vw, 1.25rem);
  line-height: 1.45;
  color: var(--ink);
  max-width: 42ch;
  text-wrap: pretty;
}
.toolcard__note { margin-top: 14px; }
.toolcard__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
  padding-top: 4px;
  min-width: 116px;
}
.toolcard__open {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  transition: color .2s ease, gap .2s ease;
}
a.toolcard:hover .toolcard__open { color: var(--accent-ink); gap: 10px; }
.toolcard__open .arr { transition: transform .2s ease; }
a.toolcard:hover .toolcard__open .arr { transform: translateX(2px); }

/* reserved future slot */
.toolcard--reserved { opacity: 0.62; }
.toolcard--reserved .toolcard__name h3 { color: var(--ink-2); font-weight: 500; }
.toolcard--reserved .toolcard__pitch { color: var(--ink-3); font-style: italic; }

@media (max-width: 680px) {
  .toolcard {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .toolcard__aside { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; gap: 10px 16px; }
  .toolcard__idx { padding-top: 0; }
}

/* ---- about / thread ----------------------------------------------------- */
.prose p { max-width: 60ch; color: var(--ink); text-wrap: pretty; }
.prose p + p { margin-top: 1.1em; }
.prose strong { font-weight: 600; }
.prose a.link {
  color: var(--accent-ink);
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  transition: border-color .2s ease;
}
.prose a.link:hover { border-bottom-color: var(--accent); }

.thread { display: flex; flex-direction: column; gap: 0; }
.thread__item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: clamp(14px, 2.5vw, 30px);
  padding: 22px 0;
  border-top: var(--rule) solid var(--line);
}
.thread__item:first-child { border-top: 0; padding-top: 0; }
.thread__when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 3px; }
.thread__what { color: var(--ink); max-width: 56ch; }
@media (max-width: 680px) {
  .thread__item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---- contact ------------------------------------------------------------ */
.contact h2 {
  font-family: var(--reading);
  font-weight: 540;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.contact h2 a {
  color: var(--accent-ink);
  border-bottom: 2px solid color-mix(in oklch, var(--accent) 35%, transparent);
  transition: border-color .2s ease;
  overflow-wrap: break-word;
}
.contact h2 a:hover { border-bottom-color: var(--accent); }
.handles {
  margin-top: clamp(26px, 4vw, 40px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.handle {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  border: var(--rule) solid var(--line-2);
  border-radius: 7px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color .2s ease, color .2s ease;
}
.handle:hover { border-color: var(--accent); color: var(--accent-ink); }
.handle .k { color: var(--ink-3); }

/* ---- footer ------------------------------------------------------------- */
.foot {
  border-top: var(--rule) solid var(--line);
  background: var(--bg-sink);
}
/* compact one-line footer: [mark] · tagline · made by · work with me → · © */
.foot__line {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(22px, 3.2vw, 32px) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
.foot__line a { color: var(--ink-2); transition: color .18s ease; }
.foot__line a:hover { color: var(--accent-ink); }
.foot__line .foot__cta { color: var(--accent-ink); }
.foot__line .foot__cta:hover { color: var(--accent); }
.foot__tag, .foot__c { color: var(--ink-3); }
.foot__sep { color: var(--line-2); user-select: none; }

/* ---- detail page -------------------------------------------------------- */
.detailhero { padding-block: clamp(40px, 7vw, 80px) clamp(34px, 5vw, 60px); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: clamp(30px, 5vw, 52px);
  transition: color .2s ease, gap .2s ease;
}
.back:hover { color: var(--accent-ink); gap: 11px; }
.detailhero__domain {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.detailhero__domain .ext { color: var(--accent-ink); }
.detailhero__tag {
  margin-top: clamp(20px, 3vw, 30px);
  font-family: var(--reading);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 480;
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 26ch;
  color: var(--ink);
  text-wrap: balance;
}
.detailhero__meta {
  margin-top: clamp(26px, 4vw, 40px);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding-top: 18px;
  border-top: var(--rule) solid var(--line);
}

.specgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: var(--rule) solid var(--line);
}
.spec { background: var(--bg); padding: 20px 22px; }
.spec dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-3); text-transform: lowercase; margin-bottom: 8px; }
.spec dd { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--ink); }
.spec dd.accent { color: var(--accent-ink); }

.steps { counter-reset: step; display: flex; flex-direction: column; }
.step {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 20px;
  padding: 24px 0;
  border-top: var(--rule) solid var(--line);
}
.step:first-child { border-top: 0; }
.step__n {
  counter-increment: step;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  padding-top: 5px;
}
.step__n::before { content: counter(step, decimal-leading-zero); }
.step h3 { font-family: var(--reading); font-size: 1.35rem; font-weight: 560; letter-spacing: -0.01em; margin-bottom: 6px; }
.step p { color: var(--ink-2); max-width: 52ch; }

/* terminal block — used sparingly on detail pages */
.terminal {
  background: var(--bg-sink);
  border: var(--rule) solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: var(--rule) solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
}
.terminal__bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.terminal__body { padding: 16px 18px; color: var(--ink-2); white-space: pre; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.terminal__body .c-out { color: var(--ink); }
.terminal__body .c-dim { color: var(--ink-3); }
.terminal__body .c-acc { color: var(--accent-ink); }
.terminal__body .c-sig { color: var(--accent-ink); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--bg);
  background: var(--ink);
  border: var(--rule) solid var(--ink);
  border-radius: 9px;
  padding: 13px 20px;
  transition: background-color .2s ease, gap .2s ease;
}
.cta:hover { background: var(--accent); border-color: var(--accent); gap: 15px; }
.cta--ghost { color: var(--ink); background: transparent; }
.cta--ghost:hover { color: var(--accent-ink); background: transparent; border-color: var(--accent); }

.ctarow { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* entrance intentionally omitted — brief calls for "no big reveals".
   the one sanctioned motion is the terminal caret. [data-rise] hooks are
   left inert in case a future, restrained treatment is wanted. */
[data-rise] { opacity: 1; transform: none; }

/* ---- mobile (≤680px): footer stack, terminal scroll, ~44px tap targets --- */
@media (max-width: 680px) {
  /* compact footer can't sit on one row — stack cleanly, drop inline middots */
  .foot__line { flex-direction: column; align-items: flex-start; gap: 11px; }
  .foot__sep { display: none; }
  .foot__line a { padding-block: 5px; }

  /* terminal: smaller mono + internal horizontal scroll, never the page */
  .terminal { font-size: 12px; }

  /* comfortable tap targets for the controls that survive on mobile */
  .nav__inner { padding-block: 9px; }
  .nav .mark,
  .nav__link--keep,
  .themebtn { min-height: 44px; }
  .nav__link--keep { display: inline-flex; align-items: center; padding-inline: 6px; }
  .themebtn { padding-inline: 14px; }
  .cta { padding: 15px 22px; }
  .handle { padding: 11px 14px; }
}
