/* The website's look (release/website.py copies it to dist/site): dark and calm, in the colours of the app's game-styled theme
   (esokit/ui/theme.py: text C5C29E, dim 8A8875, gold C5A95F). System fonts only: nothing is fetched from elsewhere. No style attributes in the
   pages: the Content-Security-Policy allows this file only. */

:root {
  --bg: #12110e;
  --panel: #1b1a16;
  --panel-2: #23211b;
  --line: #3b3729;
  --text: #c5c29e;
  --bright: #f4efdc;
  --dim: #a29f87;              /* the theme's 8A8875, lighter for contrast: 7:1 on --bg, 6.5:1 on --panel */
  --gold: #c5a95f;
  --gold-bright: #e2c77c;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* over a class's display, e.g. a hidden .button */
html { scroll-behavior: smooth; scrollbar-gutter: stable; }     /* the page doesn't shift when the popup hides its scrollbar */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); overflow-wrap: break-word; }   /* a long German word breaks on a phone */
body:has(dialog[open]) { overflow: hidden; }                /* the page stays put behind the popup */
a { color: var(--gold-bright); }
a:hover { color: var(--bright); }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1080px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }   /* across only: a section keeps its own space above */
h1, h2, h3 { font-family: var(--serif); color: var(--bright); font-weight: 600; line-height: 1.25; }
h2 { font-size: 1.9rem; margin: 0 0 1.4rem; }
h3 { font-size: 1.15rem; margin: .5rem 0 .3rem; }
section { padding: 4rem 0 0; scroll-margin-top: 1rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #1b1a16; padding: .5rem 1rem; z-index: 2; }
.skip:focus { left: 1rem; top: 1rem; }

/* the top bar */
.bar { border-bottom: 1px solid var(--line); background: #17150f; }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font: 600 1.3rem var(--serif); color: var(--bright); text-decoration: none; }
.brand:hover { color: var(--bright); }
.logo { width: 36px; height: 36px; flex: none; }
.bar .end { display: flex; align-items: center; gap: 1.6rem; }     /* the menu, then the languages */
.bar nav { display: flex; align-items: center; gap: 1.6rem; }
.bar nav a { color: var(--text); text-decoration: none; font-size: .98rem; white-space: nowrap; }
.bar nav a:hover { color: var(--bright); text-decoration: underline; text-underline-offset: 4px; }

/* the language menu: a <details>, which opens without a script; the languages by their own names in a list under the bar */
.langs { position: relative; }
.langs summary { display: flex; align-items: center; gap: .4rem; list-style: none; cursor: pointer; color: var(--text); font-size: .98rem;
                 padding: .3rem 0; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { color: var(--bright); }
.langs summary .icon { width: 20px; height: 20px; color: currentColor; }
.langs ul { position: absolute; right: 0; top: calc(100% + .6rem); z-index: 3; min-width: 11rem; margin: 0; padding: .35rem 0; list-style: none;
            background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgb(0 0 0 / .45); }
.langs a { display: block; padding: .45rem 1.1rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.langs a:hover { background: var(--panel-2); color: var(--bright); }
.langs a[aria-current] { color: var(--gold-bright); font-weight: 600; }

/* the hero */
.hero { padding: 5rem 0 4.5rem; text-align: center; border-bottom: 1px solid var(--line);
        background: radial-gradient(ellipse at 50% -10%, #3a3220 0%, transparent 65%), linear-gradient(#191712, var(--bg)); }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); margin: 0 auto 1rem; max-width: 24ch; }    /* two halves, a line each (h1 balances its lines) */
/* Japanese and Chinese: 18ch is only 9 of their letters (each about two "0"s wide), so a line of 12 em; Japanese wraps between phrases
   (word-break: auto-phrase, Chrome and Edge 119+), never inside a word, and both even out their lines */
:lang(ja) .hero h1, :lang(zh-Hans) .hero h1 { max-width: 12em; text-wrap: balance; }
:lang(ja) .lead, :lang(zh-Hans) .lead { max-width: 32em; }      /* 46ch is 23 of their letters: a measure of about 32 */
:lang(ja) .hero h1, :lang(ja) .lead { word-break: auto-phrase; }     /* the subhead too: not 「エルダー・スクロール｜ズ」 */
.lead { font-size: 1.2rem; max-width: 46ch; margin: 0 auto 2rem; color: var(--text); }
h1, h2, h3 { text-wrap: balance; }                         /* headings' lines even */
p { text-wrap: pretty; }                                    /* no word alone on a paragraph's last line ("Online." on a phone) */
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; margin: 0 0 1.4rem; }
.trust { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; justify-content: center; color: var(--dim); }
.trust li + li::before { content: "\00b7"; margin: 0 .6rem; }
.unofficial { color: var(--dim); font-size: .92rem; margin: 0; }
.nojs { color: var(--bright); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem;
        display: inline-block; margin: 0 0 1.2rem; }

/* buttons: the game's gold edge on dark */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: .8rem 1.5rem; border: 1px solid var(--gold);
          border-radius: 6px; background: linear-gradient(#3a3320, #262113); color: var(--bright); font: 600 1.05rem var(--sans);
          text-decoration: none; cursor: pointer; }
.button:hover { background: linear-gradient(#4a4128, #2e2814); color: #fff; border-color: var(--gold-bright); }
.button.secondary { background: transparent; border-color: var(--line); color: var(--text); }
.button.secondary:hover { border-color: var(--gold); color: var(--bright); background: var(--panel); }
/* Discord: its own blurple, white text (4.8:1) */
.button.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.button.discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }
.bar nav a.discord { display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .85rem; border-radius: 999px; background: #5865f2; color: #fff; }
.bar nav a.discord:hover { background: #4752c4; color: #fff; text-decoration: none; }
.bar nav a.discord .icon { width: 18px; height: 18px; }
.button .icon { width: 22px; height: 22px; color: currentColor; }
.button:disabled { cursor: not-allowed; border-color: var(--line); background: var(--panel); color: #8f8b74; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-bright); text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--bright); }

.icon { width: 30px; height: 30px; color: var(--gold); }
.icon.big { width: 40px; height: 40px; }

/* features */
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem 1.3rem; }
.feature p { margin: 0; }

/* screenshots */
.shots { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.shot { margin: 0; }
.shot img, .placeholder { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; background: var(--panel); color: var(--dim); }
.shot figcaption { color: var(--dim); font-size: .95rem; margin-top: .5rem; }

/* how it works */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1.2rem; max-width: 760px; }
.step { counter-increment: step; position: relative; padding: .2rem 0 .2rem 3.4rem; }
.step::before { content: counter(step); position: absolute; left: 0; top: .1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
                border: 1px solid var(--gold); color: var(--gold-bright); display: grid; place-items: center; font: 600 1.1rem var(--serif); }
.step h3 { margin-top: 0; }
.step p { margin: 0; }

/* download */
#download .intro { margin: 0 0 .3rem; }
.version { color: var(--dim); margin: 0 0 1rem; }
.downloads { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 1.2rem; }
.get { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column;
       align-items: flex-start; gap: .6rem; }
.get h3 { margin: 0; }
.get .note { color: var(--dim); font-size: .95rem; margin: 0 0 .6rem; }
.get .button { margin-top: auto; }

/* FAQ */
#faq details { max-width: 820px; }
.faq { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 .6rem; padding: .2rem 1.2rem; }
.faq summary { cursor: pointer; color: var(--bright); font-weight: 600; padding: .7rem 0; }
.faq[open] summary { border-bottom: 1px solid var(--line); margin-bottom: .6rem; }

footer { margin-top: 4.5rem; padding: 2rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--dim); font-size: .9rem; }
footer .legal { max-width: 80ch; margin: 0 0 .6rem; }
footer .links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 1rem 0; }

/* the popup that asks for the agreement */
.terms { width: min(680px, calc(100% - 32px)); max-width: none; max-height: min(90vh, 860px); padding: 0; border: 1px solid var(--gold);
         border-radius: 12px; background: var(--panel); color: var(--text); overflow: auto; }
.terms[open] { display: flex; flex-direction: column; }
.terms::backdrop { background: rgb(6 5 3 / .78); }
.terms h2 { font-size: 1.5rem; margin: 0; padding: 1.3rem 1.5rem .5rem; }
.terms .summary { padding: 0 1.5rem; }
.terms .summary p { margin: 0 0 .9rem; }
.terms .summary .note, .doc .note { color: var(--dim); font-size: .95rem; }     /* a translation's: the English terms apply */
.terms-text { flex: 1 1 auto; min-height: 7rem; overflow-y: auto; margin: 0 1.5rem; padding: .3rem 1.1rem .8rem; background: var(--bg);
              border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; }
.terms-text h3 { font-size: 1rem; margin: .9rem 0 .2rem; }
.terms-text p { margin: 0; }
.terms-text .terms-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: 1rem; }
.checks { border: 0; padding: 0; margin: 1rem 1.5rem 0; min-width: 0; }
.checks legend { color: var(--bright); font-weight: 600; padding: 0; margin-bottom: .3rem; }
.check { display: flex; gap: .8rem; align-items: flex-start; padding: .35rem 0; cursor: pointer; color: var(--bright); line-height: 1.45; }
.check input { width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; flex: none; accent-color: var(--gold); cursor: pointer; }
.check input:disabled { cursor: default; }
.terms .hint { color: var(--dim); margin: .5rem 1.5rem 0; font-size: .95rem; }
.actions { display: flex; justify-content: flex-end; gap: .8rem; padding: 1rem 1.5rem 1.3rem; margin-top: .9rem; border-top: 1px solid var(--line); }

/* 404 */
.lost { padding-top: 4rem; padding-bottom: 2rem; min-height: 50vh; }
.lost h1 { font-size: 2.4rem; margin: 0 0 .8rem; }
.lost .lead { margin: 0 0 1.8rem; }

/* terms.html: one readable column */
.doc { max-width: 760px; padding-top: 3rem; padding-bottom: 3rem; }
.doc h2 { margin-top: 2rem; }
.doc .lead { margin: 0 0 1rem; max-width: none; text-align: left; }
.doc ul { padding-left: 1.3rem; }
.doc li { margin: .4rem 0; }
/* "ZeniMax 利用規約（Terms of Service）" on a 320 px phone: Japanese keeps "Service）" whole, and Chrome counts a line-end "）" as
   half its width (text-spacing-trim), so the line seemed to fit and ran 8 px into the margin */
.doc li a { overflow-wrap: anywhere; text-spacing-trim: space-all; }

@media (max-width: 1000px) {                                /* below this the longest language's menu doesn't fit (Russian's needs 950) */
  .bar nav a:not(:last-child) { display: none; }            /* the menu keeps Download only (the hero has the Discord button) */
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .bar .end { gap: 1.1rem; }
  .langs-name { display: none; }                            /* the globe alone: the bar holds the mark, Download and it */
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 3rem 0 3rem; }
  .lead { font-size: 1.1rem; }
  h2 { font-size: 1.6rem; }
  section { padding-top: 3rem; }
  .cta .button { width: 100%; }
  .get .button { width: 100%; }
  .terms { width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; border-radius: 0; }
  .terms h2 { padding: 1rem 16px .4rem; font-size: 1.35rem; }
  .terms .summary, .terms .hint { padding: 0 16px; margin-left: 0; margin-right: 0; }
  .terms-text { margin: 0 16px; min-height: 9rem; }
  .checks { margin: .8rem 16px 0; }
  .check { font-size: .95rem; }
  .actions { padding: .8rem 16px 1rem; }
  .actions .button { flex: 1; padding-left: .9rem; padding-right: .9rem; }
  .actions .button.secondary { flex: none; }
  .trust { flex-direction: column; align-items: center; }   /* one under another: a wrapped row began its second line with a dot */
  .trust li + li::before { content: none; }
}

@media (max-width: 380px) {                                 /* the smallest phones: the mark, a longer Download and the globe still fit */
  .brand { font-size: 1.15rem; gap: .45rem; }
  .hero h1 { font-size: 1.75rem; }                         /* each half of the headline still a line of its own */
  .logo { width: 30px; height: 30px; }
  .bar .end { gap: .9rem; }
}
