/* edweenlo.com — "Modernist" look. Tokens and component classes follow
   design_handoff_portfolio_redesign/reference/modernist-styles.css, with a green accent. */

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

  --color-neutral-100: #f8f4f4;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;

  --color-accent: #699b65;
  --color-accent-100: #eff5ee;
  --color-accent-600: #5a8a56;
  --color-accent-700: #3f6c3c;
  --color-accent-800: #2c4f2a;

  --font: "Archivo", system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 48px);
  --rule: 2px solid var(--color-divider);
  --hair: 1px solid var(--color-divider);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
}
h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
p { margin: 0 0 12px; }
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
button { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral-700);
}

/* ---------- components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font); font-weight: 800; font-size: 14px; line-height: 1.2;
  color: var(--color-text);
  background: transparent; border: 1px solid transparent; border-radius: 0;
  padding: 8px 14.4px;
}
.btn svg { display: block; flex: none; }
.btn:hover { color: var(--color-text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-block { width: 100%; justify-content: flex-start; text-align: left; }
.btn-block svg { margin-left: auto; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; letter-spacing: 0.02em; padding: 3px 10px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }

/* segmented control: filters, layout toggle, reading mode */
.seg { display: flex; max-width: 100%; overflow-x: auto; border: var(--hair); }
.seg button {
  display: flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
  border: 0; padding: 7px 12px; font-size: 13px; line-height: 1.55;
  background: transparent; color: var(--color-text); cursor: pointer;
}
.seg button + button { border-left: var(--hair); }
.seg button:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg button[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.seg .count { opacity: 0.6; }
.seg-icons button { width: 36px; height: 34px; padding: 0; justify-content: center; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: 8px; border-bottom: var(--rule);
}
.table td { padding: 8px; border-bottom: var(--hair); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; flex-wrap: wrap; gap: 24px;
  padding: 14px var(--pad);
  background: var(--color-bg);
  border-bottom: var(--rule);
}
.brand {
  display: flex; align-items: baseline; gap: 12px;
  margin-right: auto;
  color: var(--color-text); text-decoration: none;
}
.brand:hover { color: var(--color-text); }
.brand-name {
  font-weight: 800; font-size: 22px; line-height: 1.55;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.brand-tag {
  font-size: 13px; color: var(--color-neutral-700);
  padding-left: 12px; border-left: var(--rule);
}
.site-nav { display: flex; gap: 24px; font-size: 14px; }
.site-nav a { color: var(--color-text); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px var(--pad);
  border-top: var(--rule);
  font-size: 13px; color: var(--color-neutral-700);
}
.socials { display: flex; gap: 4px; color: var(--color-text); }
.socials a { color: inherit; width: 36px; height: 36px; display: grid; place-items: center; }
.socials a:hover { color: var(--color-accent); }

/* ---------- home: banner ---------- */
.banner { background: var(--color-accent); border-bottom: var(--rule); }
.banner-inner { position: relative; max-width: 1942px; margin: 0 auto; }
.banner h1 { margin: 0; }
.banner img { width: 100%; height: auto; }
.banner-credit {
  position: absolute;
  right: clamp(10px, 2vw, 24px); bottom: clamp(8px, 1.5vw, 16px);
  font-size: 11px; letter-spacing: 0.04em; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* ---------- home: work ---------- */
.work { padding: 0 var(--pad); scroll-margin-top: 60px; }
.work-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 14px 0;
  border-top: var(--rule); border-bottom: var(--rule);
}
.work-bar .label { margin-right: 4px; }
.work-bar .seg-icons { margin-left: auto; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  border-left: var(--rule);
}
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  border-right: var(--rule); border-bottom: var(--rule);
  color: var(--color-text); text-decoration: none;
}
.card:hover { background: var(--color-surface); color: var(--color-text); }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.card-genre { color: var(--color-neutral-700); }
.card-tags { margin-left: auto; display: flex; gap: 6px; }
.card-cover { aspect-ratio: 1 / 1; overflow: hidden; background: var(--color-surface); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.2s; }
.card-bottom { display: flex; align-items: flex-end; gap: 12px; }
.card-text { flex: 1; min-width: 0; }
.card h3 { font-size: 22px; margin: 0 0 4px; text-wrap: balance; }
.card-text p { margin: 0; font-size: 13px; color: var(--color-neutral-700); }
.card-arrow { color: var(--color-accent); display: flex; }

.work-list { overflow-x: auto; }
.work-list .table { min-width: 640px; }
.work-list .col-thumb { width: 72px; }
.work-list td img { width: 56px; height: 56px; object-fit: cover; }
.cell-title { font-weight: 800; font-size: 17px; }
.cell-title a { color: var(--color-text); text-decoration: none; }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  margin-top: clamp(48px, 8vw, 96px);
  border-top: var(--rule);
  scroll-margin-top: 60px;
}
.about-page { margin-top: 0; border-top: 0; }
.about-photo-col { padding: 24px var(--pad); border-right: var(--rule); }
.about-photo { aspect-ratio: 1 / 1; max-width: 480px; overflow: hidden; filter: grayscale(1) contrast(1.08); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text { padding: 24px var(--pad); max-width: 620px; }
.about-heading { font-size: 32px; margin: 8px 0 20px; }
.about-text p { font-size: 16px; text-wrap: pretty; }

/* ---------- contact banner ---------- */
.cta {
  background: var(--color-accent); color: var(--color-bg);
  padding: clamp(40px, 7vw, 88px) var(--pad);
  scroll-margin-top: 60px;
}
.cta h2 {
  font-size: clamp(40px, 7vw, 104px); line-height: 0.92; letter-spacing: -0.035em;
  margin: 0 0 32px; max-width: 14ch;
}
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta-button {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 240px; padding: 14px 16px;
  background: var(--color-bg); color: var(--color-text);
  font-weight: 800; font-size: 15px; text-decoration: none;
}
.cta-button svg { margin-left: auto; }
.cta-button:hover { background: var(--color-accent-100); color: var(--color-text); }

/* ---------- contact page ---------- */
.contact-page { padding: clamp(32px, 6vw, 72px) var(--pad); max-width: calc(620px + 2 * var(--pad)); }
.contact-page h1 { margin: 8px 0 24px; }
#contact-form { display: flex; flex-direction: column; gap: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px;
  font: inherit; font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: var(--hair); border-radius: 0;
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
#contact-form .btn-primary { padding: 12px 14px; font-size: 15px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; min-height: 1.55em; font-size: 14px; }
.form-status.ok { color: var(--color-accent-700); font-weight: 600; }
.form-status.err { color: #b3261e; }

/* ---------- comic reader ---------- */
.reader-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 10px var(--pad);
  background: var(--color-bg);
  border-bottom: var(--rule);
}
.reader-title {
  flex: 1; min-width: 0;
  font-weight: 800; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reader-count { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--color-neutral-700); }

.reader { display: flex; flex-wrap: wrap; align-items: flex-start; }
.reader-info {
  flex: 1 1 260px; max-width: 320px;
  padding: 24px clamp(16px, 2.5vw, 32px);
  position: sticky; top: 60px;
}
.kicker { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent-700); }
.reader-info h1 {
  font-size: clamp(30px, 3vw, 44px); line-height: 0.95; letter-spacing: -0.03em;
  margin: 8px 0 16px; text-wrap: balance;
}
.logline { font-size: 15px; text-wrap: pretty; margin-bottom: 20px; }
.credits { border-top: var(--rule); }
.credit {
  display: grid; grid-template-columns: 96px 1fr; gap: 12px;
  padding: 8px 0; border-bottom: var(--hair); font-size: 13px;
}
.credit span:first-child { color: var(--color-neutral-700); }
.credit span:last-child { font-weight: 600; }
.credit-format { border-bottom: var(--rule); }
.credit-format span:last-child { font-weight: 400; }
.watch {
  margin-top: 16px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.reader-info .btn-block { margin-top: 24px; padding: 12px 14px; }

.reader-main {
  flex: 999 1 480px; min-width: 0;
  padding: 24px clamp(16px, 3vw, 40px) 64px;
  border-left: var(--rule);
}
.pages-scroll { display: flex; flex-direction: column; gap: 24px; max-width: 900px; }
.pages-scroll img { width: 100%; height: auto; background: #fff; }
.pages-scroll figcaption { font-size: 11px; margin-top: 6px; color: var(--color-neutral-700); }

.pages-single { display: flex; flex-direction: column; gap: 16px; }
.single-page {
  align-self: flex-start;
  width: auto; height: auto;
  max-width: 100%; max-height: calc(100vh - 220px);
  background: #fff; cursor: e-resize;
}
.single-controls { display: flex; gap: 8px; align-items: center; }
.hint { font-size: 12px; color: var(--color-neutral-700); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button {
  flex: none; width: 56px; padding: 0;
  border: 2px solid transparent; background: none; cursor: pointer;
}
.thumbs button[aria-current="true"] { border-color: var(--color-accent); }
.thumbs img { width: 100%; aspect-ratio: 1417 / 2000; object-fit: cover; }

/* reading mode: set on <html data-reader> before paint, toggled by reader.js */
html:not([data-reader="single"]) .pages-single,
html[data-reader="single"] .pages-scroll { display: none; }

.reader-video { margin-top: 48px; max-width: 1100px; scroll-margin-top: 72px; }
.reader-video h3 { padding-top: 12px; border-top: var(--rule); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.prev-next {
  margin-top: 48px; max-width: 1100px;
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: var(--rule);
}
.prev-next a { padding: 16px; color: var(--color-text); text-decoration: none; }
.prev-next a:first-child { padding-left: 0; border-right: var(--rule); }
.prev-next a:hover { color: var(--color-accent); }
.prev-next .label { display: block; }
.pn-title { font-weight: 800; font-size: 18px; }

/* ---------- narrow screens ---------- */
@media (max-width: 700px) {
  .about-photo-col { border-right: 0; border-bottom: var(--rule); }
}
@media (max-width: 780px) {
  .reader-info { position: static; max-width: none; }
  .reader-main { border-left: 0; border-top: var(--rule); }
}

/* ---------- blog (built only when BLOG_ENABLED) ---------- */
.blog-list, .post { max-width: 790px; padding: 32px var(--pad); }
.post-entry { padding: 24px 0; border-bottom: var(--rule); }
.post-entry.has-thumb { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
.post-thumb img { aspect-ratio: 1 / 1; object-fit: cover; }
.post-entry time, .post time { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-neutral-700); }
.post-entry h2 a { color: var(--color-text); text-decoration: none; }
.post-cover { width: 100%; margin-bottom: 24px; }
.post-pager { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 16px; border-top: var(--rule); }
