/* ============================================================
   1017_new_v1 — stylesheet
   ============================================================ */

:root {
  --bg: #f4f6f6;
  --bg-2: #fafbfb;
  --card: #ffffff;
  --ink: #16221f;
  --text: #46535a;
  --dim: #79868c;
  --edge: #e5e9e9;
  --edge-2: #eef1f1;
  --tint: rgba(13, 148, 136, 0.08);
  --acc: #0d9488;
  --acc-d: #0f766e;
  --acc-l: #2bb3a3;
  --night: #14201d;
  --night-2: #1d2c28;
  --on-night: rgba(255, 255, 255, 0.6);
  --display: "Sora", system-ui, sans-serif;
  --text-font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --rad: 12px;
  --rad-s: 8px;
  --sh: 0 1px 2px rgba(20, 32, 29, 0.04), 0 6px 24px rgba(20, 32, 29, 0.06);
  --sh-l: 0 16px 50px rgba(20, 32, 29, 0.18);
  --read: 45rem;
  --band: 62rem;
  --max: 70rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--text-font);
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--acc-d); }
button { font-family: inherit; cursor: pointer; }
h1 { font-family: var(--display); color: var(--ink); font-weight: 700; line-height: 1.18; letter-spacing: -0.015em; }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* span headings (no h2/h3 anywhere but article content) */
.h-blk, .h-wid, .h-lay, .toc__cap, .foot__cap {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  display: block;
}
.h-blk { font-size: 1.3rem; margin-bottom: 1.1rem; }
.h-wid { font-size: 1.05rem; margin-bottom: 0.3rem; }
.h-lay { font-size: 1.25rem; margin-bottom: 1.2rem; }

/* ---------- scroll progress ---------- */
.scrollline {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  background: var(--acc);
  z-index: 1200;
  transition: width 0.08s linear;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--edge);
}
.bar {
  width: 100%; max-width: var(--max);
  margin-inline: auto;
  padding: 0 1.25rem;
  min-height: 3.9rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 29px; width: auto; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 0.4rem; }
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

.navwrap { display: flex; align-items: center; gap: 1.8rem; }
.mainnav { display: flex; gap: 1.5rem; }
.mainnav a, .userbox__in {
  color: var(--text); font-weight: 600;
  font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase;
}
.mainnav a:hover, .userbox__in:hover { color: var(--acc); }
.userbox { display: flex; align-items: center; gap: 1rem; }
.userbox__up {
  background: var(--acc); color: #fff;
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.55rem 1.05rem; border-radius: var(--rad-s);
  transition: background 0.2s;
}
.userbox__up:hover { background: var(--acc-d); color: #fff; }

/* ---------- flow / shell ---------- */
.flow { padding-bottom: 4rem; }

/* ---------- post ---------- */
.post {
  max-width: var(--read);
  margin: 1.6rem auto 0;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: var(--rad);
  box-shadow: var(--sh);
  overflow: hidden;
}
.post__head { padding: 2.4rem 2.6rem 1.3rem; }
.post__title { font-size: clamp(1.7rem, 1.2rem + 2.3vw, 2.5rem); margin-bottom: 0.85rem; }

.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; font-size: 0.82rem; color: var(--dim); }
.tag { display: inline-flex; align-items: center; gap: 0.4rem; }
.tag svg { opacity: 0.7; flex-shrink: 0; }
.tag--edit { font-style: italic; }

/* toc */
.post__toc { padding: 0 2.6rem; }
.toc { background: var(--bg-2); border: 1px solid var(--edge); border-radius: var(--rad-s); padding: 1.05rem 1.25rem; }
.toc__bar { display: flex; align-items: center; justify-content: space-between; }
.toc__cap { font-size: 0.95rem; margin: 0; }
.toc__fold { background: none; border: 0; color: var(--dim); display: inline-flex; padding: 0.2rem; transition: transform 0.25s, color 0.2s; }
.toc__fold:hover { color: var(--acc); }
.toc.is-shut .toc__fold { transform: rotate(-90deg); }
.toc.is-shut .toc__links { display: none; }
.toc__links { margin-top: 0.75rem; padding-top: 0.65rem; border-top: 1px solid var(--edge); font-size: 0.9rem; line-height: 1.9; }
.toc__links a { color: var(--text); display: block; }
.toc__links a:hover { color: var(--acc); }
.toc__links .lvl-3 { padding-left: 1.1rem; font-size: 0.86rem; }

/* rich content */
.post__content { padding: 1.5rem 2.6rem 0.3rem; }
.rich { font-size: 1.02rem; line-height: 1.8; color: var(--text); }
.rich > * + * { margin-top: 1.2rem; }
.rich h2 { font-family: var(--display); color: var(--ink); font-size: 1.5rem; line-height: 1.3; margin-top: 2.3rem; padding-top: 1.3rem; border-top: 1px solid var(--edge-2); scroll-margin-top: 5rem; }
.rich h3 { font-family: var(--display); color: var(--ink); font-size: 1.22rem; margin-top: 1.7rem; scroll-margin-top: 5rem; }
.rich h4 { font-family: var(--display); color: var(--ink); font-size: 1.06rem; margin-top: 1.3rem; }
.rich a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.rich strong, .rich b { color: var(--ink); font-weight: 700; }
.rich ul, .rich ol { margin-left: 1.3rem; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich li { margin-top: 0.4rem; padding-left: 0.3rem; }
.rich img { border-radius: var(--rad-s); margin: 1.5rem 0; }
.rich blockquote {
  border-left: 3px solid var(--acc);
  background: var(--tint);
  border-radius: 0 var(--rad-s) var(--rad-s) 0;
  padding: 0.85rem 1.25rem; font-style: italic; color: var(--ink);
}
.rich code { font-family: ui-monospace, "SF Mono", "Courier New", monospace; font-size: 0.88em; background: var(--bg-2); border: 1px solid var(--edge); border-radius: 5px; padding: 0.1em 0.45em; }
.rich pre { background: var(--night); color: #e7f1ef; border-radius: var(--rad-s); padding: 1.1rem 1.3rem; overflow-x: auto; font-size: 0.88rem; line-height: 1.7; }
.rich pre code { background: none; border: 0; padding: 0; color: inherit; }
.rich table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.rich th, .rich td { padding: 0.65rem 0.8rem; border: 1px solid var(--edge); text-align: left; }
.rich th { background: var(--bg-2); color: var(--ink); font-weight: 700; }
.rich hr { border: 0; border-top: 1px solid var(--edge); margin: 2rem 0; }

/* share */
.post__share { padding: 1.7rem 2.6rem 2.4rem; }
.net { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.net__a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--edge); background: var(--card); color: var(--dim);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.net__a:hover { background: var(--acc); border-color: var(--acc); color: #fff; transform: translateY(-1px); }

/* ---------- talk / reach (forms) ---------- */
.talk, .reach {
  max-width: var(--read);
  margin: 2.2rem auto 0;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: var(--rad);
  box-shadow: var(--sh);
  padding: 2rem 2.6rem 2.1rem;
}
.reach__lead { font-size: 0.92rem; color: var(--dim); margin-top: -0.6rem; margin-bottom: 1.2rem; }

/* ---------- more (related) ---------- */
.more { max-width: var(--read); margin: 2.2rem auto 0; }
.more__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.more__a {
  display: block; background: var(--card); border: 1px solid var(--edge);
  border-radius: var(--rad-s); padding: 1.05rem 1.15rem; box-shadow: var(--sh);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.more__a:hover { transform: translateY(-2px); box-shadow: var(--sh-l); border-color: var(--acc-l); }
.more__t { font-family: var(--display); font-weight: 700; color: var(--ink); font-size: 0.96rem; line-height: 1.4; }

/* ---------- forms ---------- */
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--edge); border-radius: var(--rad-s);
  padding: 0.75rem 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus {
  outline: 0; background: var(--card); border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
textarea { resize: vertical; min-height: 6.5rem; }

.frm__row { display: flex; flex-wrap: wrap; gap: 1rem; }
.fld--half { flex: 1 1 calc(50% - 0.5rem); min-width: 0; }
.fld--full { flex: 1 1 100%; }

.join { display: flex; }
.join input { border-radius: var(--rad-s) 0 0 var(--rad-s); border-right: 0; flex: 1; min-width: 0; }
.join .bt { border-radius: 0 var(--rad-s) var(--rad-s) 0; }

/* ---------- buttons ---------- */
.bt {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink); background: var(--card); border: 1px solid var(--edge); border-radius: var(--rad-s);
  padding: 0.7rem 1.3rem; min-height: 2.85rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.bt:hover { background: var(--bg-2); border-color: var(--dim); color: var(--ink); }
.bt--solid { background: var(--acc); border-color: var(--acc); color: #fff; }
.bt--solid:hover { background: var(--acc-d); border-color: var(--acc-d); color: #fff; }
.bt--ico { padding: 0.7rem 1rem; min-width: 3rem; }
.bt--wide { width: 100%; }

/* ---------- decks (newsletter + account) ---------- */
.decks { max-width: var(--band); margin: 2.6rem auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.deck { background: var(--card); border: 1px solid var(--edge); border-radius: var(--rad); box-shadow: var(--sh); padding: 1.5rem 1.6rem; display: flex; flex-direction: column; }
.deck__lead { font-size: 0.86rem; color: var(--dim); margin-bottom: 1rem; }
.deck__btns { display: flex; flex-direction: column; gap: 0.6rem; margin-top: auto; }
.deck__btns .bt { width: 100%; }

/* ---------- footer ---------- */
.foot { background: var(--night); color: var(--on-night); margin-top: 3.4rem; padding: 2.6rem 0; }
.foot__in {
  width: 100%; max-width: var(--max); margin-inline: auto; padding: 0 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.foot__logo img { height: 28px; width: auto; filter: brightness(0) invert(1); opacity: 0.85; }
.foot__copy { font-size: 0.8rem; margin-top: 0.7rem; color: var(--on-night); }
.foot__links { display: flex; gap: 1.3rem; }
.foot__links a { color: var(--on-night); font-size: 0.85rem; }
.foot__links a:hover { color: #fff; }

.socials { display: flex; gap: 0.6rem; }
.socials a {
  display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center;
  border-radius: var(--rad-s); background: rgba(255, 255, 255, 0.08); color: var(--on-night);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.socials a:hover { background: var(--acc); color: #fff; transform: translateY(-1px); }

/* ---------- back to top ---------- */
.up {
  position: fixed; right: 1.6rem; bottom: 1.6rem;
  width: 46px; height: 46px; display: none; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--acc); color: #fff; box-shadow: var(--sh-l); z-index: 900;
  transition: background 0.2s, transform 0.18s;
}
.up:hover { background: var(--acc-d); transform: translateY(-2px); }
.up.on { display: inline-flex; }

/* ---------- cookie ---------- */
.ck {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card); border-top: 1px solid var(--edge);
  box-shadow: 0 -6px 24px rgba(20, 32, 29, 0.1); z-index: 1100; padding: 0.9rem 0;
}
.ck__in {
  width: 100%; max-width: var(--max); margin-inline: auto; padding: 0 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.ck p { font-size: 0.82rem; color: var(--text); margin: 0; }
.ck .bt { flex-shrink: 0; padding: 0.55rem 1.4rem; min-height: 2.4rem; }

/* ---------- auth layers (CSS :target modal) ---------- */
.lay { position: fixed; inset: 0; z-index: 1300; display: none; }
.lay:target { display: grid; place-items: center; padding: 1.25rem; }
.lay__bg { position: absolute; inset: 0; background: rgba(20, 32, 29, 0.55); backdrop-filter: blur(2px); }
.lay__box {
  position: relative; z-index: 1; width: min(94vw, 25rem);
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--rad);
  box-shadow: var(--sh-l); padding: 1.8rem 1.8rem 1.6rem;
  animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.lay__x {
  position: absolute; top: 0.7rem; right: 0.85rem;
  font-size: 1.5rem; line-height: 1; color: var(--dim); text-decoration: none;
}
.lay__x:hover { color: var(--ink); }
.lay .frm { display: flex; flex-direction: column; gap: 0.9rem; }
.lay__alt { font-size: 0.85rem; color: var(--dim); text-align: center; margin-top: 0.2rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .burger { display: flex; }
  .navwrap {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--edge); box-shadow: var(--sh);
    padding: 0.5rem 0; display: none;
  }
  .navwrap.open { display: flex; }
  .mainnav { flex-direction: column; gap: 0; padding: 0 1.25rem; }
  .mainnav a { padding: 0.8rem 0; border-bottom: 1px solid var(--edge-2); }
  .userbox { padding: 0.9rem 1.25rem 0.4rem; gap: 0.8rem; }

  .more__grid { grid-template-columns: 1fr 1fr; }
  .decks { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  html { font-size: 100%; }
  .post__head { padding: 1.8rem 1.4rem 1.1rem; }
  .post__toc { padding: 0 1.4rem; }
  .post__content { padding: 1.3rem 1.4rem 0.3rem; }
  .post__share { padding: 1.3rem 1.4rem 1.9rem; }
  .talk, .reach { padding: 1.6rem 1.4rem 1.8rem; }
  .more__grid { grid-template-columns: 1fr; }
  .foot__in { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .ck__in { flex-direction: column; text-align: center; gap: 0.8rem; }
}

@media (max-width: 460px) {
  .fld--half { flex: 1 1 100%; }
  .up { right: 1rem; bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .post__share, .talk, .more, .reach,
  .decks, .foot, .up, .ck, .lay, .scrollline { display: none !important; }
  body { background: #fff; }
  .post { box-shadow: none; border: 0; max-width: none; }
}
