/* MedMneme website — shared styles. White pages, flat bright yellow brand,
   Source Serif 4 headings, IBM Plex Sans text: the same look as the app. */
:root {
  --y: #FCDF02;
  --y-deep: #F2C400;
  --ink: #16171A;
  --ink-2: #3C3E44;
  --muted: #62656D;
  --faint: #8E9098;
  --line: #ECECEF;
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --soft: #FFF9D9;
  --tag-bg: #FFF3A6;
  --tag-fg: #5A4A00;
  --link: #6B5600;
  --danger: #B42318;
  --ok: #157F3B;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.05), 0 14px 32px -18px rgba(20, 20, 20, 0.3);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F1F0EA;
    --ink-2: #D9D7CE;
    --muted: #A9ABB2;
    --faint: #7F828A;
    --line: #2A2C31;
    --bg: #0E0F11;
    --card: #17181C;
    --soft: #1B1A12;
    --tag-bg: rgba(252, 223, 2, 0.14);
    --tag-fg: #FCDF02;
    --link: #FCDF02;
    --danger: #FF8A80;
    --ok: #6FD08C;
    --shadow: 0 0 0 1px #26282D, 0 18px 34px -20px rgba(0, 0, 0, 0.9);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.hidden { display: none !important; }
.serif { font-family: var(--serif); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { background: var(--y); position: sticky; top: 0; z-index: 30; }
.hdr { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #16171A; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a.nav-link { color: #16171A; text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.nav a.nav-link:hover, .nav a.nav-link[aria-current="page"] { background: rgba(255, 255, 255, 0.55); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 16px; border: 0; cursor: pointer;
  font-weight: 650; font-size: 16px; text-decoration: none; line-height: 1.2;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:active { transform: scale(0.985); }
.btn-dark { background: #16171A; color: #FFFFFF; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.6); }
.btn-dark:hover { background: #000000; }
.btn-light { background: #FFFFFF; color: #16171A; box-shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 10px 22px -14px rgba(90, 70, 0, 0.45); }
.btn-yellow { background: var(--y); color: #16171A; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--faint); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-sm { min-height: 38px; padding: 8px 16px; border-radius: 999px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.nav .btn-sm.btn-dark { box-shadow: none; }
.link-btn { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--link); font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Home hero ---------- */
.hero {
  background:
    radial-gradient(90% 70% at 85% 10%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%),
    var(--y);
  border-radius: 0 0 36px 36px; padding: 28px 0 44px; color: #16171A;
}
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); color: #4A3F00;
}
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 8vw, 58px); line-height: 1.06; letter-spacing: -0.025em; margin: 16px 0 14px; font-weight: 700; }
.hero .lead { font-size: 18px; line-height: 1.55; color: #3D3A1E; margin: 0 0 24px; max-width: 520px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 900px) {
  .hero { padding: 56px 0 72px; }
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 56px; }
}
@media (prefers-color-scheme: dark) {
  .hero { background: radial-gradient(90% 70% at 85% 0%, rgba(252, 223, 2, 0.16), rgba(252, 223, 2, 0) 60%), #121316; color: var(--ink); }
  .hero h1 { color: var(--y); }
  .hero .lead { color: #C9C6B4; }
  .eyebrow { background: rgba(252, 223, 2, 0.14); color: var(--y); }
  .hero .btn-dark { background: var(--y); color: #16171A; }
  .hero .btn-light { background: #1E1F23; color: var(--ink); box-shadow: 0 0 0 1px #2F3137; }
}

/* ---------- Login card ---------- */
.login-card {
  background: var(--card); color: var(--ink); border-radius: 28px; padding: 22px;
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 30px 60px -30px rgba(80, 60, 0, 0.55);
}
@media (prefers-color-scheme: dark) { .login-card { box-shadow: 0 0 0 1px #2C2E34, 0 30px 60px -30px rgba(0, 0, 0, 0.9); } }
.lc-title { font-family: var(--serif); font-size: 24px; font-weight: 700; margin: 2px 0 14px; letter-spacing: -0.01em; }
.lc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--soft); margin-bottom: 16px; }
.lc-tabs button { border: 0; background: transparent; padding: 10px 8px; border-radius: 11px; font-weight: 650; font-size: 15px; cursor: pointer; color: var(--muted); }
.lc-tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 20, 0.08), 0 4px 10px -6px rgba(20, 20, 20, 0.3); }
@media (prefers-color-scheme: dark) { .lc-tabs { background: #0E0F11; box-shadow: inset 0 0 0 1px #2A2C31; } .lc-tabs button.on { background: #2A2C31; } }
.field { display: block; margin: 0 0 12px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 14px;
  padding: 13px 14px; font-size: 16px; outline: none; transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field .hint { display: block; font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.form-msg { min-height: 0; margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
.form-msg:empty { margin: 0; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.lc-links { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.lc-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; margin: 16px 0; }
.lc-or::before, .lc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lc-user { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--y); color: #16171A; font-weight: 700; font-size: 20px; flex: none; }
.lc-hi { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.2; }
.lc-email { font-size: 14px; color: var(--muted); word-break: break-all; }

/* ---------- Sections ---------- */
.section { padding: 56px 0 8px; }
.section h2 { font-family: var(--serif); font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 26px; font-size: 16.5px; max-width: 620px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Year cards — the same 3D icons as the app's opening screen */
.year-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 820px) { .year-grid { grid-template-columns: repeat(3, 1fr); } }
.year-card {
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 26px; text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, var(--card) 0%, var(--soft) 140%); box-shadow: var(--shadow);
  transition: transform 0.14s ease;
}
.year-card:hover { transform: translateY(-2px); }
.year-card h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.year-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 500; }
.tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-fg); }
.icon3d {
  position: relative; flex: none; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #FFFFFF;
  background: linear-gradient(165deg, #FFEC66 0%, #FCDF02 44%, #F0BE00 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.9), inset 0 -5px 9px rgba(178, 120, 0, 0.33), 0 5px 0 #CF9C00, 0 16px 22px -10px rgba(150, 100, 0, 0.6);
}
.icon3d::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 45%;
  border-radius: 15px 15px 55% 55% / 15px 15px 32% 32%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.06)); pointer-events: none;
}
.icon3d svg { position: relative; width: 38px; height: 38px; filter: drop-shadow(0 2px 1.5px rgba(140, 88, 0, 0.6)); }
.icon3d.sm { width: 48px; height: 48px; border-radius: 15px; box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.9), inset 0 -4px 7px rgba(178, 120, 0, 0.33), 0 4px 0 #CF9C00, 0 12px 18px -9px rgba(150, 100, 0, 0.55); }
.icon3d.sm::before { left: 5px; right: 5px; top: 3px; border-radius: 11px 11px 55% 55% / 11px 11px 32% 32%; }
.icon3d.sm svg { width: 28px; height: 28px; }

.feat-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .feat-grid { grid-template-columns: repeat(4, 1fr); } }
.feat { background: var(--card); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.feat h3 { font-family: var(--serif); font-size: 19px; margin: 16px 0 6px; letter-spacing: -0.01em; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .post-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.post-card {
  display: flex; flex-direction: column; background: var(--card); border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform 0.14s ease;
}
.post-card:hover { transform: translateY(-2px); }
.post-cover { aspect-ratio: 16 / 8; background: var(--y) center / cover no-repeat; position: relative; }
.post-cover.plain {
  background: radial-gradient(120% 120% at 100% 0%, #FFF27A 0%, #FCDF02 45%, #F2C400 100%);
  display: flex; align-items: flex-end; padding: 16px 18px;
}
.post-cover.plain span { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.2; color: #16171A; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-meta { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.post-card h3 { font-family: var(--serif); font-size: 21px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.post-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.empty { padding: 28px 22px; border-radius: 24px; background: var(--soft); color: var(--muted); text-align: center; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--soft) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 24px; min-height: 220px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Blog pages ---------- */
.page-head { padding: 40px 0 22px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(34px, 7vw, 50px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 10px; }
.page-head p { color: var(--muted); margin: 0; font-size: 17px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; color: var(--muted); text-decoration: none; margin-bottom: 14px; }
.article-head { padding: 34px 0 10px; }
.article-head h1 { font-family: var(--serif); font-size: clamp(32px, 6.5vw, 48px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 14px; }
.article-meta { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.article-cover { margin: 22px 0 6px; border-radius: 24px; overflow: hidden; background: var(--soft); }
.article-cover img { display: block; width: 100%; }
.prose { font-size: 18px; line-height: 1.75; color: var(--ink-2); padding: 10px 0 8px; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-family: var(--serif); color: var(--ink); font-size: 28px; line-height: 1.2; letter-spacing: -0.015em; margin: 1.6em 0 0.5em; }
.prose h3 { font-family: var(--serif); color: var(--ink); font-size: 22px; line-height: 1.25; margin: 1.4em 0 0.4em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.prose li { margin: 0.25em 0; }
.prose li::marker { color: var(--y-deep); }
.prose strong { color: var(--ink); }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose blockquote { margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--y); background: var(--soft); border-radius: 0 16px 16px 0; color: var(--ink); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.prose img { display: block; border-radius: 18px; margin: 1.4em auto; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.prose .tbl { overflow-x: auto; margin: 1.4em 0; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--soft); color: var(--ink); font-weight: 650; }
.prose tr:last-child td { border-bottom: 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.cta-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  background: var(--y); color: #16171A; border-radius: 26px; padding: 22px; margin: 34px 0 10px;
}
.cta-card h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 4px; }
.cta-card p { margin: 0; color: #3D3A1E; }
@media (prefers-color-scheme: dark) {
  .cta-card { background: #1B1A12; color: var(--ink); box-shadow: 0 0 0 1px #3A3618; }
  .cta-card h3 { color: var(--y); }
  .cta-card p { color: var(--muted); }
  .cta-card .btn-dark { background: var(--y); color: #16171A; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; padding: 36px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 22px 40px; justify-content: space-between; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.foot-brand img { width: 30px; height: 30px; border-radius: 9px; }
.foot-brand span { font-family: var(--serif); font-weight: 700; font-size: 19px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.foot-links a:hover { text-decoration: underline; }
.foot-note { width: 100%; margin: 0; font-size: 13.5px; color: var(--faint); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #16171A; color: #FFFFFF; padding: 12px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
