:root {
  --paper:#f4f4ee;
  --panel:#fcfcf8;
  --ink:#172c31;
  --soft:#455e61;
  --line:#afc1bd;
  --accent:#16585b;
  --button:#195457;
  --on-button:#fff;
}
:root[data-theme="dark"] {
  --paper:#172529;
  --panel:#213236;
  --ink:#f2f5ee;
  --soft:#bfd2d1;
  --line:#536c70;
  --accent:#9bd9d3;
  --button:#a8ddd6;
  --on-button:#153b3c;
}
* {box-sizing:border-box}
body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:1rem/1.5 Outfit, system-ui, sans-serif;
}
:lang(fa) body {font-family:Tahoma,Arial,sans-serif;line-height:1.7}
a {color:var(--accent);text-underline-offset:.17em}
:focus-visible {outline:3px solid var(--accent);outline-offset:3px}
.skip {position:absolute;inset-inline-start:.5rem;top:-6rem;padding:.5rem;background:var(--panel)}
.skip:focus {top:0;z-index:2}
.project-header {
  display:flex;align-items:center;gap:.5rem;
  width:min(100% - 2rem,56rem);min-height:3.75rem;margin-inline:auto;
  border-block-end:1px solid var(--line);
}
.project-header .back {display:inline-flex;align-items:center;min-height:44px;font-weight:650}
.project-header button,.project-header .he-locale {
  color:var(--ink);background:var(--panel);border:1px solid var(--line);
  border-radius:.45rem;min-height:44px;padding-inline:.55rem;font:inherit;
}
.project-header button {cursor:pointer;font-size:.88rem}
main {width:min(100% - 2rem,48rem);margin:clamp(1.2rem,4vw,4rem) auto 3rem}
.context {color:var(--accent);font-size:.875rem;font-weight:650;margin:0 0 .35rem}
h1 {font-size:clamp(1.7rem,4.5vw,3.4rem);line-height:1.12;margin:0;letter-spacing:-.025em}
:lang(fa) h1 {letter-spacing:normal;line-height:1.37}
.byline {display:flex;align-items:flex-start;gap:.65rem;margin:clamp(.8rem,2.8vw,1.6rem) 0}
.byline img {border-radius:50%;object-fit:cover;flex:none}
.byline strong,.byline p {margin:0}
.byline p {max-width:62ch}
.sections {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(.45rem,2vw,1.1rem)}
figure {min-width:0;margin:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--line);border-radius:.6rem;background:var(--panel)}
figcaption {padding:.55rem .7rem;display:flex;flex:1;flex-wrap:wrap;align-content:start;gap:.05rem .6rem;align-items:baseline}
figcaption strong {color:var(--accent)}
figcaption span {color:var(--soft);font-size:.9rem}
figure img {display:block;width:100%;height:auto}
.result {border-inline-start:3px solid var(--accent);padding-inline-start:.65rem;margin:.85rem 0 1rem}
.result strong,.result span {margin-inline-end:.4em}
.primary {display:inline-flex;align-items:center;justify-content:center;min-height:44px;background:var(--button);
  color:var(--on-button);font-weight:650;text-align:center;text-decoration:none;padding:.6rem 1rem;border-radius:.5rem}
.primary:hover {text-decoration:underline}
.method,.next {border-block-start:1px solid var(--line);margin-top:1.25rem}
.method summary {width:fit-content;padding:.65rem 0;min-height:44px;font-weight:600;cursor:pointer}
.method p {max-width:66ch;margin:.3rem 0 .7rem}
.next {display:flex;flex-wrap:wrap;gap:.2rem 1.4rem;padding:.5rem 0}
.next a {display:inline-flex;align-items:center;min-height:44px}
@media(max-width:480px) {
  .project-header,main {width:calc(100% - 1.5rem)}
  .project-header {min-height:3.25rem}
  main {margin-top:.85rem}
  h1 {font-size:1.62rem}
  .byline {font-size:.94rem;line-height:1.4}
  :lang(fa) .byline {line-height:1.56}
  figcaption {padding:.38rem .45rem;font-size:.91rem;line-height:1.32}
  figcaption strong,figcaption span {display:block;width:100%}
  figcaption span {font-size:.8rem}
  :lang(fa) figcaption {line-height:1.55}
  .result {font-size:.92rem}
}
@media print {
  :root,:root[data-theme="dark"] {--paper:white;--ink:black;--accent:#164b50;--panel:white;--soft:#283b3d}
  .project-header,.skip,.primary,.next {display:none}
  main {width:100%;margin:0}
  .sections {break-inside:avoid}
}
