/* =========================================================
   base.css
   Parley Rum – Bright Pirate Foundation

   This is the “global style” file.
   It controls the overall look of the entire website:
   - colors and fonts
   - spacing and layout rules
   - shared button styles
   - shared “card/tile” styles
   - the parchment background and frame
   - age gate styling

   SAFE TO EDIT (with care):
   - the color values in :root
   - font choices in :root
   - spacing values like --container, --gutter
   - button background strength (rgba values)

   DO NOT DELETE:
   - the parchment overlay sections (body::before / body::after)
   - the .page-frame section (used site-wide)
   ========================================================= */


/* =========================================================
   SITE-WIDE VARIABLES (design settings)
   These are used everywhere via var(--name).
   Changing these updates the whole site.
   ========================================================= */
:root{
  /* Layout */
  --container: 1120px;  /* maximum content width */
  --gutter: 20px;       /* left/right padding on small screens */

  /* Corner roundness */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;

  /* Shadows (used on tiles, glass boxes, etc.) */
  --sh-soft: 0 8px 24px rgba(0,0,0,.18);
  --sh-med: 0 16px 42px rgba(0,0,0,.28);

  /* Font stack (what font the site uses) */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

  /* Core colors (SAFE TO EDIT if you want a new palette) */
  --bg: #f7efe6;          /* parchment background */
  --bg2:#efe2d2;          /* warm sand */
  --surface: rgba(255,255,255,.75);
  --surface-strong: rgba(255,255,255,.88);
  --stroke: rgba(120,80,30,.22); /* border line color */

  --text: #2b1b0f;        /* main text color */
  --muted: rgba(43,27,15,.70);
  --muted2: rgba(43,27,15,.50);

  /* Accent colors (used in buttons, highlights, etc.) */
  --gold: #c9962e;
  --amber: #d07a2d;
  --cinnamon: #b84c2a;
  --teal: #2b7a78;

  /* Focus ring (seen when keyboard-tabbing through links/buttons) */
  --ring: 0 0 0 3px rgba(208,122,45,.35);

  /* Background gradient behind the parchment texture */
  --bg-grad:
    radial-gradient(1000px 700px at 15% 10%, rgba(208,122,45,.18), transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(201,150,46,.18), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}


/* =========================================================
   BASIC RESET / DEFAULTS
   ========================================================= */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-grad);
  line-height: 1.55;
}


/* =========================================================
   PARCHMENT TEXTURE OVERLAY
   This is the “paper texture” and subtle grain.
   It sits on top of the gradient background.
   ========================================================= */

/* Body must be positioned so pseudo-elements can layer correctly */
body{
  position: relative;
}

/* The grain + mottling (paper texture) layer */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none; /* makes sure you can still click things */
  z-index: 0;

  background:
    /* subtle edge darkening like aged paper */
    radial-gradient(1200px 900px at 50% 40%,
      rgba(0,0,0,.00) 0%,
      rgba(0,0,0,.05) 62%,
      rgba(0,0,0,.10) 100%
    ),

    /* warm “aged” corners */
    radial-gradient(900px 700px at 12% 18%, rgba(208,122,45,.16), transparent 62%),
    radial-gradient(900px 700px at 88% 22%, rgba(201,150,46,.14), transparent 62%),
    radial-gradient(900px 700px at 40% 86%, rgba(184,76,42,.10), transparent 62%),

    /* paper fiber grain (two directions) */
    repeating-linear-gradient(
      0deg,
      rgba(40,25,12,.018) 0px,
      rgba(40,25,12,.018) 1px,
      transparent 1px,
      transparent 5px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(40,25,12,.012) 0px,
      rgba(40,25,12,.012) 1px,
      transparent 1px,
      transparent 7px
    ),

    /* faint mottling */
    radial-gradient(circle at 20% 35%, rgba(60,35,16,.06), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.08), transparent 60%),
    radial-gradient(circle at 45% 75%, rgba(60,35,16,.05), transparent 62%);

  opacity: .78;
  mix-blend-mode: multiply;

  /* NOTE: You set z-index twice. The last one “wins”. */
  z-index: -1;
}

/* Soft paper sheen layer (slight highlight) */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  background:
    radial-gradient(900px 600px at 30% 20%, rgba(255,255,255,.20), transparent 60%),
    radial-gradient(900px 700px at 70% 80%, rgba(255,255,255,.10), transparent 62%);

  opacity: .55;
  mix-blend-mode: screen;

  /* Again, last z-index wins */
  z-index: -1;
}


/* =========================================================
   ENSURE CONTENT SITS ABOVE THE BACKGROUND LAYERS
   This prevents the parchment overlays from covering text/buttons.
   ========================================================= */
.site-header,
main,
section,
footer{
  position: relative;
  z-index: 1;
}

/* NOTE: You repeat this rule twice in your original.
   That is harmless, but we can remove the duplicate later. */
.site-header,
section,
footer{
  position: relative;
  z-index: 1;
}


/* =========================================================
   TYPOGRAPHY (headings and paragraphs)
   ========================================================= */
h1,h2,h3{
  margin: 0 0 10px;
}
h1{ font-size: clamp(32px, 4vw, 60px); }
h2{ font-size: clamp(22px, 2.5vw, 34px); }
h3{ font-size: clamp(16px, 1.6vw, 20px); }

p{ margin: 0 0 12px; color: var(--muted); }


/* =========================================================
   LAYOUT HELPERS (used across pages)
   ========================================================= */
.container{
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}
.section{ padding: 56px 0; }
.center-row{ display:flex; justify-content:center; margin-top: 20px; }


/* =========================================================
   HEADER (shared)
   This sets the header to stick to the top while you scroll.
   ========================================================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
}

.navbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 16px 0;
}

.brand{
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text);
}

.nav a{
  margin-left: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--muted);
}
.nav a:hover{
  background: rgba(208,122,45,.15);
  color: var(--text);
}


/* =========================================================
   “GLASS” PANEL STYLE (semi-transparent card look)
   Used on hero panels, feature blocks, etc.
   ========================================================= */
.glass{
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-med);
}


/* =========================================================
   BUTTONS (site-wide)
   SAFE TO EDIT: background strength and padding.
   ========================================================= */
.btn{
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(208,122,45,.18);
  color: var(--text);
}
.btn:hover{
  background: rgba(208,122,45,.28);
}


/* =========================================================
   FOOTER (shared)
   ========================================================= */
.site-footer{
  border-top: 1px solid var(--stroke);
  background: rgba(255,255,255,.85);
}
.footer-inner{
  padding: 22px 0;
  color: var(--muted2);
  font-size: 13px;
}


/* =========================================================
   TILES (shared “card” component used everywhere)
   ========================================================= */
.tile{
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: var(--surface-strong);
  box-shadow: var(--sh-soft);
  overflow:hidden;
}

.tile-media{
  height: 260px;
  background-size: cover;
  background-position: center;
}

.tile-body{
  padding: 16px;
}

.tile-title{
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tile-text{
  font-size: 13px;
  color: var(--muted);
}


/* =========================================================
   DECKLED PARCHMENT EDGE (site-wide frame)
   Requires your pages to wrap content inside:
   <div class="page-frame"> ... </div>
   ========================================================= */
.page-frame{
  position: relative;
  min-height: 100vh;

  /* keeps content off the torn edges */
  padding: 10px 10px;

  /* top padding makes room for the sticky header */
  padding-top: 92px;

  border-radius: 26px;
  background: transparent;
}

/* The parchment “sheet” underneath the content */
.page-frame::before{
  content:"";
  position: fixed;
  inset: 10px;
  z-index: 0;
  pointer-events: none;

  background:
    radial-gradient(1200px 900px at 40% 35%, rgba(255,255,255,.22), transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.10));

  border-radius: 26px;

  /* mask creates a “torn/deckled” edge feel */
  -webkit-mask:
    radial-gradient(28px 18px at 26px 26px, #000 97%, transparent 100%),
    radial-gradient(28px 18px at calc(100% - 26px) 26px, #000 97%, transparent 100%),
    radial-gradient(28px 18px at 26px calc(100% - 26px), #000 97%, transparent 100%),
    radial-gradient(28px 18px at calc(100% - 26px) calc(100% - 26px), #000 97%, transparent 100%),
    linear-gradient(#000, #000);

  -webkit-mask-composite: source-over;

  /* mild blur makes the edge feel more natural */
  filter: blur(.15px);
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
}

/* Adds irregular edge noise + vignette (more realism) */
.page-frame::after{
  content:"";
  position: fixed;
  inset: 10px;
  z-index: 0;
  pointer-events: none;

  border-radius: 26px;

  background:
    radial-gradient(1200px 900px at 50% 45%, rgba(0,0,0,0) 55%, rgba(0,0,0,.08) 100%),
    repeating-radial-gradient(circle at 10% 10%,
      rgba(0,0,0,.045) 0 1px,
      transparent 1px 6px
    );

  opacity: .45;
  mix-blend-mode: multiply;

  /* mask keeps this effect mostly around the edges */
  -webkit-mask:
    radial-gradient(closest-side, transparent 82%, #000 90%);
}

/* All content inside .page-frame sits above the parchment sheet */
.page-frame > *{
  position: relative;
  z-index: 1;
}


/* =========================================================
   SCROLL OFFSET FOR ANCHOR LINKS
   Example: clicking a link to #our-story
   This ensures the section title isn’t hidden behind the sticky header.
   ========================================================= */
:root{
  --header-h: 92px; /* adjust if needed */
}

html{
  scroll-padding-top: calc(var(--header-h) + 12px);
}

[id]{
  scroll-margin-top: calc(var(--header-h) + 12px);
}


/* =========================================================
   AGE GATE (21+ overlay)
   The look/positioning is here.
   The behavior (show/hide) is controlled by js/script.js.
   ========================================================= */

.no-scroll { overflow: hidden; } /* applied to <html> to prevent background scrolling */

.age-gate{
  display: none; /* hidden until JS shows it */
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.age-gate__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
}

.age-gate__panel{
  position: relative;
  width: min(560px, calc(100% - 32px));
  margin: 12vh auto 0;
  padding: 22px 20px;
  border-radius: var(--r-lg);
  background: rgba(18, 14, 10, .92);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--sh-med);
  color: rgba(255,255,255,.92);
}

.age-gate__panel h2{
  margin: 0 0 8px;
  letter-spacing: .3px;
}

.age-gate__panel p{
  margin: 0 0 14px;
  color: rgba(255,255,255,.82);
}

.age-gate__actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.age-gate__fineprint{
  margin-top: 14px;
  font-size: .9rem;
  color: rgba(255,255,255,.65);
}

/* Backup button styles for the age gate area
   (useful if global button styles ever change) */
.age-gate .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.age-gate .btn-primary{
  background: rgba(255,255,255,.92);
  color: #140f0b;
  border-color: rgba(255,255,255,.25);
}

.age-gate .btn-ghost{
  background: transparent;
  color: rgba(255,255,255,.9);
}
