:root {
  --ink: #17231f;
  --muted: #5f6f69;
  --paper: #f6f1e8;
  --paper-2: #fffaf1;
  --forest: #173f36;
  --teal: #1d8f8a;
  --gold: #e7a949;
  --clay: #b76e44;
  --line: rgba(23, 35, 31, .13);
  --shadow: 0 24px 80px rgba(20, 42, 36, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(231, 169, 73, .22), transparent 29rem),
    radial-gradient(circle at 96% 28%, rgba(29, 143, 138, .13), transparent 31rem),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  line-height: 1.6;
}

a { color: inherit; }
button, input, textarea { font: inherit; }
.wrap { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}
.brand img { display: block; width: 148px; height: 44px; object-fit: contain; }
.header-links { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; font-weight: 700; }
.header-links a { text-decoration: none; }
.header-links a:hover { color: var(--forest); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--forest);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(23, 63, 54, .18);
}
.button:hover { background: #0f332b; }
.button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(29, 143, 138, .42); outline-offset: 3px; }

.blog-hero { padding: 90px 0 74px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: var(--clay);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
h1, h2, h3 { line-height: 1; letter-spacing: -.05em; }
h1 { max-width: 900px; margin: 0; font-size: clamp(54px, 9vw, 112px); }
.lead { max-width: 720px; margin: 26px 0 0; color: var(--muted); font-size: clamp(18px, 2.1vw, 24px); }

.post-list { display: grid; gap: 28px; padding: 22px 0 110px; }
.post-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: .86fr 1.14fr;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 250, 241, .82);
  box-shadow: var(--shadow);
}
.post-art {
  position: relative;
  min-height: 320px;
  background:
    linear-gradient(145deg, rgba(23, 63, 54, .22), rgba(23, 63, 54, .82)),
    url('../hero-pono-beach.jpg') center / cover;
}
.post-art::after {
  content: "P";
  position: absolute;
  right: 24px;
  bottom: -42px;
  color: rgba(255, 255, 255, .16);
  font-size: 240px;
  font-weight: 900;
  line-height: 1;
}
.post-art-human { background-position: 62% center; }
.post-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 5vw, 68px); }
.post-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.lock-badge { padding: 6px 10px; border-radius: 999px; background: rgba(231, 169, 73, .18); color: #7a5419; }
.post-copy h2 { margin: 20px 0 18px; font-size: clamp(36px, 5vw, 62px); }
.post-copy p { margin: 0 0 28px; color: var(--muted); font-size: 18px; }
.post-link { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; color: var(--forest); font-weight: 850; text-decoration: none; }
.post-link span { transition: transform .2s ease; }
.post-link:hover span { transform: translateX(5px); }

.entry-shell { padding: 60px 0 110px; }
.entry-back { display: inline-flex; gap: 8px; color: var(--muted); font-weight: 750; text-decoration: none; }
.entry-back:hover { color: var(--forest); }
.gate {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  overflow: hidden;
  max-width: 980px;
  min-height: 580px;
  margin: 48px auto 0;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: rgba(255, 250, 241, .9);
  box-shadow: var(--shadow);
}
.gate-art {
  position: relative;
  padding: 38px;
  color: white;
  background:
    linear-gradient(150deg, rgba(23, 63, 54, .48), rgba(12, 49, 42, .94)),
    url('../hero-pono-beach.jpg') center / cover;
}
.gate-art p { position: absolute; right: 38px; bottom: 32px; left: 38px; margin: 0; color: rgba(255,255,255,.76); }
.lock-icon { display: grid; place-items: center; width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.28); border-radius: 18px; background: rgba(255,255,255,.13); font-size: 24px; }
.gate-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 7vw, 76px); }
.gate-form h1 { font-size: clamp(42px, 6vw, 72px); }
.gate-form > p { margin: 18px 0 30px; color: var(--muted); }
.field-label { display: block; margin: 0 0 9px; font-size: 14px; font-weight: 800; }
.password-row { display: flex; gap: 10px; }
.password-wrap { position: relative; flex: 1; }
.password-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 0 52px 0 16px;
  border: 1px solid rgba(23, 35, 31, .22);
  border-radius: 15px;
  color: var(--ink);
  background: white;
}
.reveal {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.reveal:hover { background: var(--paper); }
.error { min-height: 24px; margin: 10px 0 0; color: #9e3e2d; font-size: 14px; font-weight: 700; }

.article { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 62px 0 120px; }
.article[hidden], .gate[hidden] { display: none; }
.article-header { padding-bottom: 44px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 18px 0 22px; font-size: clamp(48px, 8vw, 86px); }
.article-deck { color: var(--muted); font-size: clamp(19px, 2.2vw, 24px); }
.article-meta { margin-top: 24px; color: var(--muted); font-size: 14px; }
.article-body { padding-top: 34px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.8; }
.article-body p { margin: 0 0 1.35em; }
.article-body h2 { margin: 1.5em 0 .55em; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 36px; }
.article-body h3 { margin: 1.4em 0 .5em; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 26px; letter-spacing: -.035em; }
.article-body .standfirst { font-size: 26px; line-height: 1.55; color: var(--forest); }
.article-body blockquote { margin: 2em 0; padding: 24px 28px; border-left: 4px solid var(--gold); background: rgba(231, 169, 73, .1); font-size: 20px; line-height: 1.55; }

.writer-gate-art { background-image: linear-gradient(150deg, rgba(23, 63, 54, .54), rgba(12, 49, 42, .94)), url('../hero-pono-beach.jpg'); }
.writer[hidden], .preview-panel[hidden] { display: none; }
.writer { padding: 54px 0 110px; }
.writer-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.writer-head h1 { font-size: clamp(50px, 7vw, 88px); }
.writer-head p { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.draft-status { flex: 0 0 auto; padding: 9px 13px; border-radius: 999px; color: var(--forest); background: rgba(29, 143, 138, .12); font-size: 13px; font-weight: 800; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.editor-panel { padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255, 250, 241, .86); box-shadow: 0 14px 42px rgba(20, 42, 36, .07); }
.editor-main { display: grid; gap: 24px; }
.editor-sidebar { position: sticky; top: 20px; display: grid; gap: 18px; }
.editor-field { display: grid; gap: 8px; }
.editor-field > span, .editor-field > label { font-size: 14px; font-weight: 850; }
.editor-field input, .editor-field textarea { width: 100%; border: 1px solid rgba(23, 35, 31, .2); border-radius: 15px; color: var(--ink); background: white; }
.editor-field input { min-height: 50px; padding: 0 14px; }
.editor-field textarea { resize: vertical; padding: 14px; line-height: 1.6; }
.editor-field .body-editor { min-height: 480px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; }
.format-toolbar { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px; border: 1px solid rgba(23, 35, 31, .16); border-bottom: 0; border-radius: 15px 15px 0 0; background: #f2ede4; }
.format-toolbar button { min-width: 42px; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 13px; font-weight: 800; cursor: pointer; }
.format-toolbar button:hover { color: white; background: var(--forest); }
.format-toolbar + .body-editor { border-radius: 0 0 15px 15px; }
.format-help { color: var(--muted); font-size: 12px !important; font-weight: 600 !important; }
.editor-actions { display: grid; gap: 10px; }
.button-light { color: var(--forest); background: white; border: 1px solid var(--line); box-shadow: none; }
.button-light:hover { background: var(--paper); }
.button-gold { color: #2c2414; background: var(--gold); }
.button-gold:hover { background: #dda03e; }
.editor-note { margin: 4px 0 0; padding: 15px; border-radius: 15px; color: var(--muted); background: rgba(231, 169, 73, .1); font-size: 13px; }
.preview-panel { margin-top: 44px; overflow: hidden; border: 1px solid var(--line); border-radius: 30px; background: var(--paper-2); box-shadow: var(--shadow); }
.preview-top { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; color: white; background: var(--forest); }
.text-button { border: 0; color: rgba(255,255,255,.8); background: transparent; cursor: pointer; }
.text-button:hover { color: white; }
.danger-button { padding: 8px; color: #8f4437; }
.danger-button:hover { color: #6f2e24; }
.preview-article { padding-bottom: 70px; }

footer { padding: 28px 0 50px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }

@media (min-width: 761px) {
  .blog-hero h1 { font-size: clamp(52px, 7.2vw, 90px); }
  .gate-form h1 { font-size: clamp(40px, 4.8vw, 58px); }
  .article-header h1 { font-size: clamp(46px, 6.4vw, 69px); }
  .writer-head h1 { font-size: clamp(48px, 5.6vw, 70px); }
}

@media (max-width: 760px) {
  .site-header { padding: 17px 0; }
  .brand img { width: 112px; }
  .header-links a:first-child { display: none; }
  .blog-hero { padding-top: 58px; }
  .post-card, .gate, .editor-grid { grid-template-columns: 1fr; }
  .post-art { min-height: 260px; }
  .gate-art { min-height: 210px; }
  .gate { margin-top: 28px; }
  .password-row { flex-direction: column; }
  .password-row .button { width: 100%; }
  .writer-head { display: block; }
  .draft-status { display: inline-flex; margin-top: 18px; }
  .editor-sidebar { position: static; }
  .editor-panel { padding: 20px; }
  .footer-inner { display: block; }
}

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