/* css/base.css: Yasara's tokens, fonts and shared components ("portolan and brass"). Loaded by every page. */

@font-face { font-family: 'Fell SC'; src: url('/fonts/FellSC.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fell'; src: url('/fonts/FellItalic.woff2') format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/fonts/AlegreyaSans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/fonts/AlegreyaSans-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/fonts/AlegreyaSans-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('/fonts/AlegreyaSans-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --ink: #2B1D12;
  --ink-2: #5A4430;
  --ink-3: #8A7257;
  --parchment: #F2E4C4;
  --parchment-2: #E5D0A2;
  --parchment-3: #D6BC86;
  --brass: #B8862E;
  --brass-hi: #E9C46A;
  --brass-lo: #7A5518;
  --sea: #1B5E6B;
  --sea-deep: #0E3640;
  --sea-night: #082229;
  --foam: #CFE7E2;
  --azulejo: #2F5DA6;
  --terracotta: #C0532B;
  --wax: #A3242B;
  --wax-hi: #C8443F;
  --wax-lo: #6E1419;
  --olive: #6E7A3A;
  --wheat: #E2B44B;
  --pepper: #3A3631;
  --nutmeg: #8A5A33;
  --clove: #6B2E24;
  --cinnamon: #B5652B;
  --good: #3F7D4E;
  --bad: #A3242B;

  --display: 'Fell SC', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --flourish: 'Fell', 'Iowan Old Style', Palatino, Georgia, serif;
  --ui: 'Alegreya Sans', 'Gill Sans', 'Segoe UI', system-ui, sans-serif;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 248, 225, .55) inset, 0 10px 28px -12px rgba(43, 29, 18, .55);
  --glass: rgba(9, 38, 45, .78);
  --glass-2: rgba(14, 54, 64, .9);
  --rose-a: #E9C46A;
  --rose-b: #8A5F1C;
  --rose-c: #A3242B;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--parchment);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--azulejo); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.ico { flex: none; }

/* --- textures --------------------------------------------------------------------------------------------------- */
/* parchment: layered warm gradients plus a faint fibre noise (inline SVG turbulence, no image request) */
.parchment {
  background-color: var(--parchment);
  background-image:
    radial-gradient(120% 80% at 20% 0%, rgba(255, 250, 232, .7), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(181, 133, 63, .18), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .24 0 0 0 0 .12 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* rhumb lines: the radiating lines of a portolan chart, drawn by an inline SVG */
.rhumbs { position: relative; isolation: isolate; }
.rhumbs::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: var(--rhumb-op, .22);
  background: url('/img/rhumbs.svg') center / cover no-repeat;
}

/* --- buttons ---------------------------------------------------------------------------------------------------- */
.btn {
  --b: var(--brass); --bh: var(--brass-hi); --bl: var(--brass-lo); --t: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.25em; border: 0; border-radius: 999px;
  font-family: var(--ui); font-weight: 800; font-size: 1rem; letter-spacing: .02em; text-decoration: none;
  color: var(--t);
  background: linear-gradient(180deg, var(--bh), var(--b) 55%, var(--bl));
  box-shadow: 0 1px 0 rgba(255, 245, 210, .7) inset, 0 -2px 0 rgba(0, 0, 0, .18) inset, 0 6px 14px -6px rgba(43, 29, 18, .6);
  transition: transform .12s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { filter: grayscale(.7) opacity(.6); cursor: not-allowed; transform: none; }
/* the wax seal: the one primary action on a screen */
.btn.wax { --b: var(--wax); --bh: var(--wax-hi); --bl: var(--wax-lo); --t: #FBEBD6; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; color: inherit; }
.btn.sea { --b: var(--sea); --bh: #2B8090; --bl: var(--sea-deep); --t: var(--foam); }
.btn.sm { min-height: 36px; padding: .3em .9em; font-size: .9rem; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 44px; }
.btn.icon.sm { width: 36px; }

/* --- cards ------------------------------------------------------------------------------------------------------ */
/* parchment card with a deckled (torn) edge made by a mask of small radial bites */
.card {
  position: relative; border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow);
}
/* a chart frame: thin double ink rule inside the card */
.framed { box-shadow: var(--shadow), inset 0 0 0 1px rgba(90, 68, 48, .55), inset 0 0 0 5px var(--parchment), inset 0 0 0 6px rgba(90, 68, 48, .35); }
.glass {
  background: var(--glass); color: var(--foam);
  border: 1.5px solid rgba(233, 196, 106, .55);
  border-radius: var(--r);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 12px 30px -14px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .15em .65em; border-radius: 999px;
  font-size: .82rem; font-weight: 700; letter-spacing: .03em;
  background: rgba(43, 29, 18, .08); color: var(--ink-2);
}
.chip.open { background: var(--brass-hi); color: var(--ink); }
.chip.live { background: var(--good); color: #F2F7EE; }
.kicker { font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; font-size: .95rem; color: var(--brass-lo); }
.flourish { font-family: var(--flourish); font-style: italic; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .02em; line-height: 1.05; }

/* brass ring: round instrument frames */
.ring {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F6DE9B, var(--brass) 45%, var(--brass-lo) 100%);
  padding: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 8px 18px -8px rgba(0, 0, 0, .7), inset 0 1px 1px rgba(255, 250, 220, .7);
}
.ring > * { border-radius: 50%; }

.tag-good { color: var(--good); }
.tag-bad { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* sea chart drawing */
.sc-coast { fill: #E9D7AA; stroke: #7A5518; stroke-width: 1.4; }
.sc-hatch { stroke: #7A5518; stroke-width: .6; opacity: .45; }
.sc-leg { fill: none; stroke: var(--azulejo); stroke-width: 1.6; stroke-dasharray: 5 5; }
.sc-port circle { fill: var(--wax); stroke: #FBEBD6; stroke-width: 2; }
.sc-port.walk circle { fill: var(--brass); }
.sc-port text { font-family: var(--display); font-size: 17px; fill: var(--ink); }
.sc-min { font-family: var(--ui); font-size: 12px; font-weight: 700; fill: var(--azulejo); }
.sc-leg.shut { stroke: #8a7a62; opacity: .5; stroke-dasharray: 2 6; }
.sc-port.shut circle { fill: #f3e9d5; stroke: #8a7a62; stroke-dasharray: 3 3; }
.sc-port.shut text { fill: #7a6a52; font-size: 15px; }
.sc-title { font-family: var(--flourish); font-style: italic; font-size: 20px; fill: var(--ink-2); }
