/* artefactlegends.com: the landing page. The look is the game's own (development/frontend/src/styles/base.css, the
 * account screens): the harbour backdrop, Alex's ivory panel and control skins as nine-slices, Barlow Condensed for
 * headings and buttons, the navy and orange of the trailer cards. Files under /media, /ui and /fonts are cached for a
 * year: never change one under the same name, add a new name. */

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/barlow-condensed-latin-700.woff2') format('woff2');
  ascent-override: 95%;
  descent-override: 25%;
}

:root {
  color-scheme: dark;
  --ink: #263038;
  --ink-soft: #565a50;
  --ivory: #fff8e8;
  --orange: #de7944;
  --link: #92451f;
  --link-hover: #be5e2d;
  --focus-on-ivory: #844621;
  --focus-on-dark: #fff3cf;
  --night: #10151c;
  --heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--night); }

body {
  min-width: 300px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ivory);
  /* The trailer cards' backdrop: navy at the centre, near-black at the edges. */
  background: radial-gradient(ellipse at 50% 30%, #203040 0%, #141b24 55%, var(--night) 100%) fixed;
}

img,
video { display: block; max-width: 100%; height: auto; }

a,
button,
summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

:focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: 3px; }

/* ---- The ivory panel of the account screens (assets/ui/auth/panel.png, 32 px slices at 2x). ---- */
.panel {
  position: relative;
  isolation: isolate;
  color: var(--ink);
}
.panel::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 16px solid transparent;
  border-image: url('/ui/panel.png') 32 fill / 16px stretch;
  pointer-events: none;
}
.panel :focus-visible { outline-color: var(--focus-on-ivory); }

/* ---- Hero: the harbour of the login screen behind the account-card panel. ---- */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: max(40px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 48px max(24px, env(safe-area-inset-left));
  background: #6c9dc6 url('/media/harbour-1600.webp') center / cover no-repeat;
}
@media (max-width: 960px) {
  .hero { background-image: url('/media/harbour-960.webp'); }
}
@media (max-aspect-ratio: 4/5) {
  .hero { background-image: url('/media/harbour-portrait.webp'); background-position: center bottom; }
}

.hero__panel {
  width: 100%;
  max-width: 560px;
  padding: 30px 32px 28px;
  text-align: center;
}

.hero__logo {
  width: 128px;
  height: 128px;
  margin: -6px auto 10px;
  filter: drop-shadow(0 2px 3px #29313759);
  user-select: none;
}

.hero__title {
  margin: 0;
  color: #293137;
  font: 700 clamp(38px, 9vw, 54px)/1 var(--heading);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.hero__slogan {
  margin: 6px 0 0;
  color: #b4592a;
  font: 700 clamp(17px, 4.2vw, 21px)/1.15 var(--heading);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__line {
  max-width: 44ch;
  margin: 14px auto 22px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: balance;
}

.hero__note {
  margin: 22px 0 0;
  padding: 11px 13px;
  border-left: 3px solid #c56a31;
  color: #484f48;
  background: #e0dacb;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.hero__note strong { color: var(--ink); }

/* ---- Controls: Alex's control skins (assets/ui/inventory/control-*.png), 32 px slices at 2x, one image per state. ---- */
.control {
  --skin: url('/ui/control-dark-idle.png');
  --skin-hover: url('/ui/control-dark-hover.png');
  --skin-clicked: url('/ui/control-dark-clicked.png');
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  border: 0;
  border-radius: 0;
  color: var(--ivory);
  background: transparent;
  font: 700 22px/1 var(--heading);
  letter-spacing: 0.5px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.control::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border: 16px solid transparent;
  border-image: var(--skin) 32 fill / 16px stretch;
  pointer-events: none;
}
.control:hover::before,
.control:focus-visible::before { border-image-source: var(--skin-hover); }
.control:active::before { border-image-source: var(--skin-clicked); }
.control:active .control__label { transform: translateY(1px); }
.control:focus-visible { outline: 3px solid var(--focus-on-ivory); outline-offset: 3px; }

.control--primary,
.control.is-yours {
  --skin: url('/ui/control-primary-idle.png');
  --skin-hover: url('/ui/control-primary-hover.png');
  --skin-clicked: url('/ui/control-primary-clicked.png');
}

.control--large {
  min-height: 66px;
  font-size: 30px;
  letter-spacing: 0.8px;
}

.control:disabled,
.control[aria-disabled='true'] {
  --skin: url('/ui/control-dark-disabled.png');
  --skin-hover: url('/ui/control-dark-disabled.png');
  --skin-clicked: url('/ui/control-dark-disabled.png');
  color: #eef1ec;
  cursor: not-allowed;
}
.control:disabled .control__label,
.control[aria-disabled='true'] .control__label { transform: none; }

.control__label { display: block; }
/* Platform names keep their own spelling (macOS, iOS); the game's buttons are otherwise upper case. */
.control__label--name { text-transform: none; letter-spacing: 0.3px; }
.control__detail {
  display: block;
  font: 700 14px/1.1 Arial, Helvetica, sans-serif;
  letter-spacing: 0.2px;
  text-transform: none;
  opacity: 0.92;
}
.control__detail:empty { display: none; }

/* Every hover and pressed skin is fetched with the page, so the first hover never paints a blank button. */
body::after {
  content: '';
  position: absolute;
  top: 0;
  left: -10px;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  background-image: url('/ui/control-dark-hover.png'), url('/ui/control-dark-clicked.png'), url('/ui/control-dark-disabled.png'),
    url('/ui/control-primary-hover.png'), url('/ui/control-primary-clicked.png'), url('/ui/control-primary-idle.png');
}

/* ---- Downloads ---- */
.downloads { margin-top: 24px; }

.downloads__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--ink);
  font: 700 20px/1 var(--heading);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.downloads__heading::before,
.downloads__heading::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #c9c2b1;
}
.downloads__heading--mobile { margin-top: 18px; }

.downloads__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.downloads__list--mobile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.downloads__list li { display: flex; }

.downloads__version,
.downloads__note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .downloads__list { grid-template-columns: minmax(0, 1fr); }
  .downloads__list--mobile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Sections below the hero ---- */
main {
  display: grid;
  gap: 28px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

.section { padding: 28px 32px 30px; }

.section__heading {
  margin: 0 0 18px;
  color: var(--ink);
  font: 700 clamp(28px, 5vw, 36px)/1.05 var(--heading);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.section__copy {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

.section__note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

/* The dark outline the game draws around its item frames. */
.frame {
  padding: 3px;
  background: #283039;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.frame > img,
.frame > video {
  width: 100%;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}

.trailer { aspect-ratio: 16 / 9; background: #10151c; }

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shots figure { margin: 0; }
.shots img { aspect-ratio: 16 / 9; background: #cfc8b8; }
.shots figcaption {
  margin-top: 8px;
  color: var(--ink);
  font: 700 19px/1.1 var(--heading);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@media (max-width: 759px) {
  .shots { grid-template-columns: minmax(0, 1fr); }
}

/* ---- First time opening the app ---- */
.help {
  margin-top: 10px;
  background: #f4f0e4;
  box-shadow: inset 0 0 0 2px #c9c2b1;
}
.help summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  color: var(--ink);
  font: 700 21px/1 var(--heading);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::before {
  content: '';
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-right: 12px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #c56a31;
  transition: transform 160ms ease;
}
.help[open] summary::before { transform: rotate(90deg); }
.help summary:hover { background: #ebe5d6; }
.help summary:focus-visible { outline-offset: -3px; }
.help.is-yours summary::after {
  content: 'Your system';
  margin-left: auto;
  padding: 4px 8px;
  color: var(--ivory);
  background: #c56a31;
  font: 700 13px/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0.3px;
  text-transform: none;
}
.help ol {
  margin: 0;
  padding: 2px 20px 16px 40px;
  color: #3f433f;
  font-size: 15px;
  line-height: 1.6;
}
.help li + li { margin-top: 6px; }
.help code {
  padding: 1px 5px;
  color: var(--ink);
  background: #e3ddcd;
  font: 14px/1.4 ui-monospace, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* ---- Footer ---- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 24px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px max(32px, env(safe-area-inset-bottom));
  color: #c8ccc6;
  font-size: 14px;
}
.footer p { margin: 0; }
.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ivory);
  font-weight: 700;
  text-underline-offset: 3px;
}
.footer a:hover { color: #f3a363; }

/* ---- Small phones ---- */
@media (max-width: 600px) {
  .hero { padding: max(20px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 28px max(12px, env(safe-area-inset-left)); }
  .hero__panel { padding: 24px 20px 22px; }
  .hero__logo { width: 96px; height: 96px; margin: -4px auto 8px; }
  .hero__line { font-size: 15px; }
  .control--large { font-size: 27px; }
  main { gap: 20px; padding: 28px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
  .section { padding: 22px 20px 24px; }
}

@media (max-width: 360px) {
  .hero__panel { padding: 22px 16px 20px; }
  .section { padding: 20px 16px 22px; }
  .help ol { padding-left: 32px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
