/* HumanWroteThis — shared stylesheet */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=DM+Serif+Display:ital@0;1&family=Special+Elite&family=Caveat:wght@400;600&display=swap');

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

:root {
  --paper:   #f5f1e8;
  --paper2:  #ece7d9;
  --paper3:  #e2dccf;
  --border:  #cec7b5;
  --muted:   #b0a896;
  --stone:   #8a8070;
  --mid:     #5a5248;
  --ink2:    #38322c;
  --ink:     #1c1814;
  --red:     #7a1f1f;

  --serif:   'DM Serif Display', Georgia, serif;
  --sans:    'DM Sans', system-ui, sans-serif;
  --type:    'Special Elite', 'Courier New', monospace;
  --hand:    'Caveat', cursive;
}

html { scroll-behavior: smooth; }

body {
  background: #fcfaf7;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ────────────────────────────────────────── */

nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245,241,232,0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 40px;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--serif); font-size: 18px; color: var(--ink);
  text-decoration: none; letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo-svg { height: 15px; width: auto; display: block; }
.nav-logo-mark { font-size: 17px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 13px; font-weight: 400; color: var(--stone);
  text-decoration: none; padding: 8px 14px; border-radius: 4px;
  transition: color 0.15s;
}
.nav-link:hover,
.nav-link.active { color: var(--ink); }
.nav-cta {
  background: var(--ink); color: var(--paper);
  border: none; padding: 9px 20px; border-radius: 4px;
  font-family: var(--sans); font-weight: 400; font-size: 13px;
  text-decoration: none; cursor: pointer; transition: background 0.15s;
  display: inline-block;
}
.nav-cta:hover { background: var(--ink2); }
.nav-cta.active-page { background: var(--ink2); }

@media(max-width:600px){
  .nav-inner { padding: 0 20px; }
  .nav-link { display: none; }
}

/* ── LAYOUT ─────────────────────────────────────── */

.wrap        { max-width: 1080px; margin: 0 auto; padding: 0 40px; }
.wrap-mid    { max-width: 820px;  margin: 0 auto; padding: 0 40px; }
.wrap-narrow { max-width: 620px;  margin: 0 auto; padding: 0 40px; }

@media(max-width:600px){
  .wrap,.wrap-mid,.wrap-narrow { padding: 0 20px; }
}

section { padding: 96px 0; border-top: 1px solid var(--border); }

/* ── TYPOGRAPHY ─────────────────────────────────── */

.eyebrow {
  font-size: 11px; font-weight: 400; letter-spacing: 3px;
  text-transform: uppercase; color: var(--stone); margin-bottom: 18px;
}
.sec-title {
  font-family: var(--serif);
  font-size: clamp(30px, 3.8vw, 50px);
  font-weight: 400; letter-spacing: -1.5px; line-height: 1.1;
  color: var(--ink); margin-bottom: 18px;
}
.sec-sub {
  font-size: 17px; font-weight: 300; color: var(--mid); line-height: 1.75;
}
.hand-note {
  font-family: var(--hand); font-size: 17px; color: var(--stone);
  font-weight: 400;
}

/* ── BUTTONS ────────────────────────────────────── */

.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 400;
  padding: 13px 26px; border-radius: 4px; border: none;
  transition: all 0.15s; letter-spacing: 0.1px;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink2); }
.btn-ghost {
  background: transparent; color: var(--mid);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--stone); color: var(--ink); }
.btn-lg { padding: 15px 32px; font-size: 15px; }

/* ── HAND-DRAWN UNDERLINE ────────────────────────── */

.u-hand {
  position: relative; display: inline;
  padding-bottom: 10px;
}
.u-hand::after {
  content: '';
  position: absolute; left: -2px; right: -2px; bottom: 0px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M2,8 C8,2 18,2 26,7 C34,12 44,11 54,6 C64,1 76,2 86,8 C96,12 107,11 118,6 C129,1 141,3 151,8 C161,12 172,11 183,5 C194,1 206,2 218,8 C228,12 240,10 252,6 C264,2 276,3 288,7 C294,10 298,8 300,8' stroke='%237a1f1f' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/100% 100%;
}

/* ── TYPEWRITER TEXTAREA ────────────────────────── */

.typewriter-wrap {
  position: relative;
  background: #faf6ee;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
}
.typewriter-area {
  display: block; width: 100%;
  background: transparent;
  border: none; outline: none;
  padding: 36px 44px;
  font-family: var(--type); font-size: 17px; line-height: 1.9;
  color: var(--ink); resize: none; min-height: 340px;
  /* lined paper */
  background-image: repeating-linear-gradient(
    transparent 0px, transparent calc(1.9em * 17px / 17),
    rgba(180,168,145,0.18) calc(1.9em * 17px / 17),
    rgba(180,168,145,0.18) calc(1.9em * 17px / 17 + 1px)
  );
}
.typewriter-area:focus { outline: none; }

/* Simpler lined paper using fixed px */
.typewriter-area {
  background-image: repeating-linear-gradient(
    transparent,
    transparent 31px,
    rgba(180,168,145,0.22) 31px,
    rgba(180,168,145,0.22) 32px
  );
  background-attachment: local;
  line-height: 32px;
}

.typewriter-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 44px 14px;
  border-top: 1px solid rgba(180,168,145,0.3);
  font-size: 12px; font-weight: 300; color: var(--muted);
}
.typewriter-rule {
  font-family: var(--type); font-size: 11px; color: var(--muted);
  letter-spacing: 0.5px;
}

/* ── CODE DISPLAY ───────────────────────────────── */

.code-display {
  font-family: var(--type); font-size: 22px; font-weight: 400;
  color: var(--ink); letter-spacing: 2px;
}
.code-sig {
  font-family: var(--type); font-size: 14px; color: var(--mid);
  letter-spacing: 0.5px; line-height: 1.7;
}

/* ── STEP GRID ──────────────────────────────────── */

.steps-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; margin-top: 56px;
}
@media(max-width:680px){ .steps-grid { grid-template-columns:1fr; } }
.step-card { background: var(--paper); padding: 36px 32px; }
.step-n {
  font-family: var(--hand); font-size: 22px; color: var(--muted);
  margin-bottom: 18px; display: block;
}
.step-card h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  color: var(--ink); margin-bottom: 10px; letter-spacing: -0.3px;
}
.step-card p { font-size: 14px; font-weight: 300; color: var(--mid); line-height: 1.7; }

/* ── PERSONA GRID ───────────────────────────────── */

.persona-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 14px; margin-top: 56px;
}
@media(max-width:680px){ .persona-grid { grid-template-columns:1fr 1fr; } }
@media(max-width:480px){ .persona-grid { grid-template-columns:1fr; } }
.persona-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 26px 24px;
}
.persona-n {
  font-family: var(--hand); font-size: 16px; color: var(--muted);
  display: block; margin-bottom: 12px;
}
.persona-card h3 {
  font-family: var(--serif); font-size: 17px; font-weight: 400;
  color: var(--ink); margin-bottom: 7px;
}
.persona-card p { font-size: 13px; font-weight: 300; color: var(--mid); line-height: 1.6; }

/* ── POST MOCK ──────────────────────────────────── */

.post-mock {
  background: var(--paper2); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
}
.post-mock-label {
  border-bottom: 1px solid var(--border); padding: 9px 18px;
  font-size: 10px; font-weight: 400; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--stone);
}
.post-mock-body { padding: 20px 18px; font-size: 14px; font-weight: 300; color: var(--ink2); line-height: 1.7; }
.post-mock-sig { font-family: var(--type); font-size: 11px; color: var(--stone); margin-top: 14px; line-height: 1.6; }

/* ── PLUGIN MOCKUP ──────────────────────────────── */

.plugin-browser { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.plugin-bar {
  background: var(--paper3); border-bottom: 1px solid var(--border);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
}
.plugin-dots { display: flex; gap: 5px; }
.plugin-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.plugin-url {
  flex: 1; background: var(--paper2); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 10px; font-size: 11px; color: var(--stone);
}
.plugin-popup { background: var(--paper2); }
.plugin-popup-head {
  background: var(--paper3); border-bottom: 1px solid var(--border);
  padding: 11px 14px; display: flex; align-items: center; gap: 9px;
}
.plugin-icon {
  width: 24px; height: 24px; background: var(--ink); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--paper);
}
.plugin-title { font-size: 12px; font-weight: 500; color: var(--ink); }
.plugin-sub { font-size: 10px; color: var(--stone); font-weight: 300; }
.plugin-body { padding: 12px 14px; }
.plugin-hint { font-size: 10px; color: var(--stone); margin-bottom: 8px; font-weight: 300; }
.plugin-ta {
  width: 100%; background: #faf6ee; border: 1px solid var(--border);
  border-radius: 3px; padding: 8px 10px; font-family: var(--type); font-size: 11px;
  color: var(--ink2); resize: none; height: 72px; line-height: 1.55; font-weight: 400;
}
.plugin-foot { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.plugin-btn {
  background: var(--ink); color: var(--paper); border: none; padding: 9px;
  border-radius: 3px; font-family: var(--sans); font-size: 11px; cursor: pointer; width: 100%;
}
.plugin-result {
  background: var(--paper3); border: 1px solid var(--border); border-radius: 3px; padding: 9px 10px;
}
.plugin-res-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--stone); margin-bottom: 4px; }
.plugin-res-sig { font-family: var(--type); font-size: 10px; color: var(--ink2); line-height: 1.7; }
.plugin-copy {
  background: transparent; border: 1px solid var(--border); color: var(--stone);
  padding: 4px 8px; border-radius: 2px; font-size: 9px; cursor: pointer; margin-top: 6px; display: inline-block;
}

/* ── FOOTER ─────────────────────────────────────── */

footer {
  padding: 28px 40px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12px; font-weight: 300; color: var(--stone);
}
footer a { color: var(--stone); text-decoration: none; }
footer a:hover { color: var(--ink); }
@media(max-width:600px){ footer { flex-direction:column; text-align:center; padding:24px 20px; } }

/* ── UTILITIES ──────────────────────────────────── */

.text-center { text-align: center; }
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mt40 { margin-top: 40px; }
.mt56 { margin-top: 56px; }

/* Error/notice message */
.notice {
  font-size: 12px; font-weight: 300; color: var(--red);
  font-family: var(--type); letter-spacing: 0.3px;
  min-height: 18px; margin-top: 8px;
}
