@font-face {
  font-family: "PT Serif";
  src: url("assets/pt-serif.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "PT Serif";
  src: url("assets/pt-serif-italic.ttf") format("truetype");
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --cream: #f8f5ed;
  --paper: #fffdf6;
  --ink: #252d26;
  --muted: #575e52;
  --green: #243e30;
  --moss: #4d6249;
  --rust: #a04832;
  --line: #d9d7c9;
  --serif: "PT Serif", Georgia, serif;
  --gutter: clamp(1.1rem, 5vw, 5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 1rem/1.58 system-ui, sans-serif; }
[hidden] { display: none !important; }
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; width: 100%; height: auto; }
figure, h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.11; letter-spacing: -.042em; }
em { color: var(--moss); }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
section[id] { scroll-margin-top: 1.3rem; }
.shell { width: min(78rem, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 5; transform: translateY(-150%); background: var(--paper); padding: .75rem; }
.skip:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; min-height: 5.15rem; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; color: var(--green); font: 2rem/1 var(--serif); letter-spacing: -.07em; text-decoration: none; }
.brand > span:last-child { color: var(--rust); }
.brand-icon {
  position: relative;
  flex: 0 0 auto;
  width: 1.12rem;
  height: 1.44rem;
  margin-right: .58rem;
  border-radius: 2px 4px 4px 2px;
  background: linear-gradient(90deg, var(--green) 15%, #94a58e 15% 20%, var(--green) 20%);
}
.brand-icon::after {
  content: "";
  position: absolute;
  right: 19%;
  bottom: -12%;
  width: 23%;
  height: 36%;
  background: #bd6547;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 77%, 0 100%);
}
.navigation, .account { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); }
.navigation a, .account a { text-decoration: none; font-size: .9rem; font-weight: 550; }
.account { gap: 1.15rem; }
.navigation a:hover, .account > a:first-child:hover { color: var(--rust); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 2.9rem;
  border-radius: .28rem;
  padding: .62rem 1rem;
  border: 1px solid transparent;
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.button-solid { color: var(--paper); background: var(--green); }
.button-solid:hover { background: #385743; }
.button-outline { color: var(--green); border-color: #9aa495; background: transparent; }
.button-outline:hover { background: #e7e9df; }
.account .button { min-height: 2.55rem; }
.text-link { color: var(--green); font-size: .93rem; font-weight: 650; text-underline-offset: .25em; }
.text-link:hover { color: var(--rust); }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; margin-top: 1.55rem; background: #ede9dc; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(2.5rem, 5.1vw, 5.25rem); }
.kicker { display: flex; align-items: center; gap: .55rem; color: var(--rust); font-size: .72rem; font-weight: 750; letter-spacing: .125em; text-transform: uppercase; }
.kicker::before { content: ""; width: .35rem; height: .35rem; border-radius: 50%; background: currentColor; }
.hero h1 { margin-top: 1.1rem; font-size: clamp(2.9rem, 5.6vw, 5.2rem); letter-spacing: -.066em; line-height: 1.01; }
.lead { max-width: 31rem; margin-top: 1.35rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.67; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.3rem; margin-top: 1.55rem; }
.hero-image { min-height: clamp(26rem, 42vw, 35.25rem); position: relative; overflow: hidden; background: #bdad89; }
.hero-image img { position: absolute; height: 100%; object-fit: cover; object-position: center 47%; }

.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.quick-links > * { display: flex; gap: .8rem; align-items: center; text-align: left; text-decoration: none; background: none; color: var(--ink); border: 0; padding: 1.12rem clamp(.55rem, 2vw, 1.6rem); }
.quick-links > * + * { border-left: 1px solid var(--line); }
.quick-links > *:hover { background: #eeebe1; }
.quick-symbol { width: 2rem; flex: 0 0 2rem; color: var(--rust); text-align: center; font-size: 1.55rem; }
.quick-links strong, .quick-links small { display: block; }
.quick-links strong { font-size: .94rem; font-weight: 700; }
.quick-links small { color: var(--muted); font-size: .78rem; }
.quick-arrow { margin-left: auto; color: var(--moss); }

.section { padding-block: clamp(2.8rem, 6.4vw, 5.6rem); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem 2.6rem; margin-bottom: 1.65rem; }
.section-head h2, .faq h2 { font-size: clamp(2.3rem, 4.7vw, 4rem); margin-top: .35rem; }
.section-head > p { max-width: 26rem; color: var(--muted); }
.notice { padding: .85rem 1rem; background: #eee8d6; }

.workspace { border: 1px solid #c9cdbf; border-radius: .5rem; overflow: hidden; background: var(--paper); box-shadow: 0 14px 32px #463c2410; }
.workspace-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 4.4rem; padding: .7rem 1.15rem; background: #e9ece1; border-bottom: 1px solid #cbd1c1; }
.workspace-name { display: inline-flex; align-items: center; color: var(--green); font: 1.28rem/1.2 var(--serif); }
.workspace-name .brand-icon { width: .85rem; height: 1.07rem; }
.workspace-actions { display: flex; gap: .55rem; }
.workspace-actions .button { min-height: 2.5rem; padding: .44rem .75rem; }
.workspace-main { display: grid; grid-template-columns: minmax(15rem, 27%) minmax(0, 1fr); min-height: 25rem; }
.notebook-sidebar { padding: 1rem .8rem; min-width: 0; background: #f3f3e9; border-right: 1px solid #dfe0d3; }
.search-box { display: flex; align-items: center; padding: 0 .72rem; gap: .53rem; border: 1px solid #a7ae9e; border-radius: .28rem; background: var(--paper); }
.search-box:focus-within { outline: 2px solid var(--rust); outline-offset: 2px; }
.search-icon { position: relative; border: 1.5px solid var(--moss); border-radius: 50%; width: .69rem; height: .69rem; flex: 0 0 .69rem; }
.search-icon::after { content: ""; position: absolute; width: .3rem; height: 1.5px; top: 90%; left: 82%; transform: rotate(45deg); background: var(--moss); }
.search-box input { width: 100%; min-width: 0; height: 2.44rem; padding: 0 .18rem; background: none; border: 0; font-size: .9rem; }
.search-box input:focus { outline: none; }
.note-filters { display: flex; flex-wrap: wrap; gap: .28rem; margin: .78rem 0 .58rem; }
.note-filters button { padding: .32rem .55rem; background: transparent; border: 1px solid transparent; border-radius: .25rem; font-size: .75rem; font-weight: 650; }
.note-filters button:hover { border-color: #a7b0a1; }
.note-filters [aria-pressed="true"] { color: var(--green); background: #dce5d7; }
.note-list { display: grid; gap: .25rem; align-content: start; max-height: 22rem; overflow-y: auto; padding: .24rem; margin: -.24rem; }
.note-row { display: block; text-align: left; width: 100%; min-width: 0; padding: .62rem .6rem; border: 1px solid transparent; border-radius: .25rem; background: transparent; }
.note-row:hover { background: #ecefe5; }
.note-row[aria-current="true"] { border-color: #a4b19e; background: var(--paper); }
.note-row strong, .note-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row strong { font-size: .91rem; }
.note-row small, .empty-list { color: var(--muted); font-size: .77rem; margin-top: .15rem; }
.empty-list { padding: .55rem; }

.editor { min-width: 0; padding: clamp(.95rem, 2.8vw, 2rem); }
.editor-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-bottom: .8rem; border-bottom: 1px solid #e3e0d2; }
.entry-kind { color: var(--moss); font-size: .71rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.editor-actions button, .undo button { padding: .27rem .42rem; border: 1px solid transparent; border-radius: .2rem; color: var(--green); background: transparent; font-size: .8rem; font-weight: 600; }
.editor-actions button:hover, .undo button:hover { border-color: #acb3a4; }
.editor-actions .delete-action { color: #923f30; }
.editor-actions button[aria-pressed="true"] { background: #e6ebe0; }
.entry-title, .entry-body { display: block; width: 100%; padding: .28rem .14rem; border: 0; background: transparent; }
.entry-title { margin: .9rem 0 .45rem; font: clamp(1.65rem, 3.6vw, 2.65rem)/1.2 var(--serif); letter-spacing: -.04em; }
.entry-body { min-height: 13.5rem; resize: vertical; line-height: 1.75; }
.entry-title::placeholder, .entry-body::placeholder, input::placeholder { color: #656e63; opacity: 1; }
.editor-empty { display: grid; place-content: center; gap: .6rem; text-align: center; color: var(--muted); }
.editor-empty h3 { color: var(--green); font-size: 1.8rem; }
.task-progress { margin: .7rem 0 .3rem; color: var(--muted); font-size: .84rem; }
.task-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.task-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .4rem; border-bottom: 1px solid #ebe7da; }
.task-list label { display: flex; align-items: start; gap: .62rem; padding: .53rem .08rem; overflow-wrap: anywhere; cursor: pointer; }
.task-list input { width: 1rem; height: 1rem; margin: .26rem 0 0; flex-shrink: 0; accent-color: var(--moss); }
.task-list input:checked + span { color: var(--muted); text-decoration: line-through; }
.task-list button { background: transparent; color: var(--rust); border: 0; width: 2rem; height: 2rem; }
.task-list button:hover { background: #f2e6dc; }
.task-form { display: flex; gap: .5rem; }
.task-form input { width: 100%; min-width: 0; padding: .52rem .67rem; border: 1px solid #a7ae9e; border-radius: .28rem; background: transparent; }
.task-form .button { min-height: 2.55rem; padding-block: .44rem; }
.workspace-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem .8rem; min-height: 2.6rem; padding: .42rem .95rem; background: #f2f2e8; border-top: 1px solid #dfe0d3; color: var(--muted); font-size: .78rem; }
.undo { display: flex; align-items: center; gap: .4rem; }

.template-section { background: #eeeade; border-block: 1px solid #e3dfd1; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem; }
.template-card { display: flex; position: relative; min-height: 13.2rem; flex-direction: column; align-items: start; padding: clamp(1rem, 2.65vw, 2rem); border-radius: .22rem; border: 1px solid #00000010; }
.template-card.peach { background: #f0ddd1; }
.template-card.sage { background: #dfe6d8; }
.template-card.ochre { background: #eee4c9; }
.template-kind { color: var(--green); font-size: .7rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.template-card h3 { font-size: clamp(1.45rem, 2.75vw, 2.1rem); margin: .55rem 0 .32rem; }
.template-card > p:not(.template-kind) { color: var(--muted); font-size: .91rem; }
.use-template { display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; margin-top: auto; padding: .7rem 0 0; border: 0; background: transparent; text-align: start; color: var(--green); font-size: .86rem; font-weight: 700; }
.use-template:hover { color: var(--rust); }
.use-template span[aria-hidden] { font-size: 1.2rem; }

.practice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 4.25vw, 3.6rem); align-items: start; }
.practice-image { background: #d6c7a7; }
.practice-image img { aspect-ratio: 1.55; object-fit: cover; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: .9rem .2rem; color: var(--green); font-weight: 650; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--rust); font-size: 1.24rem; line-height: 1.2; }
details[open] > summary::after { content: "−"; }
summary:hover { color: var(--rust); }
details p { padding: 0 1.3rem .95rem .2rem; font-size: .95rem; color: var(--muted); }
details ul { margin: -.3rem 0 .95rem; padding: 0 1.3rem 0 1.35rem; color: var(--muted); font-size: .95rem; }
details li + li { margin-top: .3rem; }
.faq { display: grid; grid-template-columns: .85fr 1.2fr; gap: 2rem; border-top: 1px solid var(--line); }

.footer { padding: 2.7rem 0; background: var(--green); color: #f0eee3; }
.footer .brand { color: #fffcf1; }
.footer .brand-icon { background: linear-gradient(90deg, #cdd8c7 18%, var(--green) 18% 24%, #cdd8c7 24%); }
.footer .brand > span:last-child { color: #eeb196; }
.footer p { color: #d6ded0; font-size: .91rem; margin-top: .65rem; }
.footer-inner { display: grid; grid-template-columns: 1.7fr 1fr 1fr auto; gap: 1rem 1.5rem; }
.footer nav { display: flex; flex-direction: column; gap: .3rem; }
.footer nav a, .top-link { font-size: .9rem; text-decoration: none; }
.footer nav a:hover, .top-link:hover { text-decoration: underline; }

.auth-open { overflow: hidden; }

.auth-dialog {
  width: min(100% - 2rem, 27rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 60px #161d154d;
}

.auth-dialog::backdrop { background: #202a22a6; }
.auth-panel { padding: clamp(1.15rem, 5.5vw, 2rem); }
.auth-head { display: flex; align-items: start; justify-content: space-between; gap: .7rem; margin-bottom: 1.25rem; }
.auth-head h2 { font-size: clamp(1.95rem, 7vw, 2.55rem); }
.auth-close {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid #a7ae9e;
  border-radius: .28rem;
  background: transparent;
  color: var(--green);
  font-size: 1.55rem;
  line-height: 1;
}
.auth-close:hover { background: #e7e9df; }
.auth-panel label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 650; }
.auth-panel input {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem .65rem;
  margin-bottom: 1rem;
  border: 1px solid #a7ae9e;
  border-radius: .28rem;
  background: #fff;
}
.auth-panel .button { width: 100%; margin-top: .2rem; }
.auth-error {
  display: none;
  margin-top: .8rem;
  padding: .65rem .8rem;
  border-left: 3px solid var(--rust);
  background: #f7eae2;
  color: #87381f;
}
.auth-error.visible { display: block; }

@media (max-width: 54rem) {
  .header-inner { gap: .8rem; }
  .site-header .brand { font-size: 1.7rem; }
  .navigation { gap: .9rem; }
  .hero-copy { padding: 2.25rem 1.55rem; }
  .hero-image { min-height: 23rem; }
  .section-head > p { max-width: 18rem; }
}

@media (max-width: 44rem) {
  .header-inner { flex-wrap: wrap; padding: .78rem 0 .6rem; gap: .55rem .75rem; }
  .navigation { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .6rem; gap: .35rem; }
  .navigation a { font-size: .83rem; }
  .account { gap: .7rem; }
  .account .button { min-height: 2.1rem; padding: .34rem .55rem; font-size: .82rem; }
  .hero { grid-template-columns: 1fr; margin-top: .8rem; }
  .hero-copy { padding: 1.85rem 1.18rem; }
  .hero h1 { font-size: clamp(2.75rem, 10.4vw, 4.2rem); }
  .hero-image { min-height: 0; aspect-ratio: 1.3; }
  .lead { margin-top: 1rem; }
  .hero-actions { margin-top: 1.15rem; }
  .quick-links { grid-template-columns: 1fr; padding: .35rem 0; }
  .quick-links > * { padding: .45rem .25rem; }
  .quick-links > * + * { border-left: 0; border-top: 1px solid var(--line); }
  .section-head { align-items: start; flex-direction: column; gap: .65rem; }
  .section-head > p { max-width: 32rem; }
  .workspace-main { grid-template-columns: 1fr; }
  .notebook-sidebar { border-right: 0; border-bottom: 1px solid #dfe0d3; padding: .8rem; }
  .workspace-name { font-size: 1.1rem; }
  .note-list { max-height: 12.3rem; }
  .entry-body { min-height: 10rem; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .template-card { min-height: 11rem; }
  .practice-grid, .faq { grid-template-columns: 1fr; gap: 1rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > div { grid-column: 1 / -1; }
}

@media (max-width: 24rem) {
  .workspace-name { font-size: 1rem; }
  .workspace-head { padding-inline: .6rem; }
  .workspace-actions { gap: .3rem; }
  .workspace-actions .button { font-size: .8rem; padding-inline: .45rem; }
  .editor-actions { gap: 0; }
  .editor-actions button { font-size: .73rem; padding-inline: .25rem; }
  .template-card h3 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
