/* ==========================================================================
   BrewSense — designsystem från Google Stitch (DESIGN.md), handskrivet i CSS.
   Mörkt gränssnitt: kalksten och char-ek som grund, malt-bärnsten som accent.
   ========================================================================== */

:root {
  /* Ytor */
  --surface: #0c0d10;
  --surface-lowest: #08090a;
  --surface-low: #121316;
  --surface-container: #18191d;
  --surface-high: #222327;

  /* Text */
  --on-surface: #e3e2e6;
  --on-surface-variant: #8e8c89;

  /* Accenter */
  --primary: #ffc174;
  --primary-strong: #f59e0b;
  --outline: #7a7672;
  --outline-variant: #232428;

  /* Typografi */
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-label: 'Space Grotesk', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Mått */
  --shell: 82rem;
  --gutter: 1.25rem;
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --header-h: 5rem;

  color-scheme: dark;
}

@media (min-width: 48em) {
  :root { --gutter: 3rem; --header-h: 6rem; }
}

/* --- Grund ---------------------------------------------------------------- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

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

a { color: inherit; }

::selection { background: rgba(255, 193, 116, 0.22); color: var(--primary); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: #2a1700;
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Typografiska byggstenar ---------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.375rem, 1.2rem + 5vw, 4.75rem); }
h2 { font-size: clamp(1.875rem, 1.1rem + 3.2vw, 3rem); line-height: 1.15; }
h3 { font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem); font-weight: 400; }

h1 em {
  font-style: italic;
  color: var(--primary);
}

p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--on-surface-variant);
  line-height: 1.65;
  max-width: 42ch;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
  font-family: var(--font-label);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}
.eyebrow-primary { color: var(--primary); opacity: 0.85; }
.eyebrow-sep { color: var(--outline-variant); }

.dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
  flex: none;
}

blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.45;
  color: rgba(227, 226, 230, 0.9);
  text-wrap: pretty;
}
blockquote::before { content: '”'; }
blockquote::after { content: '”'; }

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: rgba(12, 13, 16, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(35, 36, 40, 0.7);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}
.brand:hover .brand-mark { opacity: 1; }

.brand-text { display: flex; flex-direction: column; }

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand-place {
  font-family: var(--font-label);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 3rem);
}

.site-nav a {
  font-family: var(--font-label);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(142, 140, 137, 0.85);
  text-decoration: none;
  transition: color 0.25s ease;
}
.site-nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  place-items: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.125rem;
  height: 1px;
  background: var(--on-surface);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -0.375rem; }
.nav-toggle-bars::after { top: 0.375rem; }

.nav-toggle[aria-expanded='true'] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded='true'] .nav-toggle-bars::before { transform: translateY(0.375rem) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle-bars::after { transform: translateY(-0.375rem) rotate(-45deg); }

@media (max-width: 47.99em) {
  .nav-toggle { display: grid; }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 var(--gutter);
    max-height: 0;
    overflow: hidden;
    background: rgba(12, 13, 16, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid transparent;
    transition: max-height 0.35s ease, border-color 0.35s ease;
  }

  body.nav-open .site-nav {
    max-height: 70vh;
    border-bottom-color: rgba(35, 36, 40, 0.7);
  }

  .site-nav a {
    width: 100%;
    padding: 1.125rem 0;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(35, 36, 40, 0.6);
  }
  .site-nav a:last-child { border-bottom: 0; }
}

/* --- Sektioner ------------------------------------------------------------ */

main { padding-top: var(--header-h); }

.section { padding-block: clamp(4.5rem, 3rem + 8vw, 9rem); }
.section-rule { border-bottom: 1px solid rgba(35, 36, 40, 0.75); }
.section-sunken { background: rgba(8, 9, 10, 0.5); }

.section-intro { max-width: 44rem; margin-bottom: clamp(3rem, 2rem + 4vw, 4rem); }
.section-intro .lead { margin-top: 1.25rem; max-width: 46ch; }

.split {
  display: grid;
  gap: clamp(3rem, 2rem + 5vw, 5rem);
  align-items: center;
}

@media (min-width: 62em) {
  .split { grid-template-columns: 5fr 7fr; }
  .split-even { grid-template-columns: 1fr 1fr; }
}

.split-narrow > * + * { margin-top: 1.5rem; }
.split-narrow blockquote {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(35, 36, 40, 0.9);
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-block: clamp(4rem, 2.5rem + 9vw, 8rem);
  display: flex;
  align-items: center;
  min-height: 85vh;
}

.hero-grid {
  display: grid;
  gap: clamp(3rem, 2rem + 5vw, 4rem);
  align-items: end;
}

@media (min-width: 62em) {
  .hero-grid { grid-template-columns: 2fr 1fr; }
}

.hero-copy h1 { margin-bottom: 2.5rem; max-width: 20ch; }
.hero-copy .lead { max-width: 54ch; }

.hero-figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(35, 36, 40, 0.9);
  background: var(--surface-low);
  overflow: hidden;
}

.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.25);
  opacity: 0.75;
  transition: transform 1s ease, opacity 1s ease;
}
.hero-figure:hover img { transform: scale(1.05); opacity: 0.9; }

.hero-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface) 0%, transparent 65%);
  opacity: 0.85;
  pointer-events: none;
}

.hero-figure figcaption {
  position: absolute;
  inset: auto 1.5rem 1.5rem;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(122, 118, 114, 0.35);
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(142, 140, 137, 0.95);
}
.hero-figure .accent { color: var(--primary); }

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: clamp(3.5rem, 2rem + 6vw, 5rem) 0 0;
  padding-top: 3rem;
  border-top: 1px solid rgba(35, 36, 40, 0.75);
}

@media (min-width: 40em) {
  .facts { grid-template-columns: repeat(4, 1fr); }
}

.fact dt {
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 193, 116, 0.75);
  margin-bottom: 0.4rem;
}

.fact dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 300;
}

/* --- Kort ----------------------------------------------------------------- */

.card-pair {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 40em) {
  .card-pair { grid-template-columns: 1fr 1fr; }
}

.card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(35, 36, 40, 0.9);
  background: rgba(18, 19, 22, 0.6);
  transition: border-color 0.35s ease, transform 0.35s ease;
}
.card:hover {
  border-color: rgba(245, 158, 11, 0.28);
  transform: translateY(-2px);
}

.card h3 { margin-bottom: 0.75rem; }

.card p:not(.card-index):not(.card-foot) {
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
  line-height: 1.65;
}

.card-index,
.card-foot {
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.card-index { color: var(--primary); margin-bottom: 1rem; }

.card-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(35, 36, 40, 0.8);
  color: rgba(142, 140, 137, 0.7);
  letter-spacing: 0.15em;
}

/* --- Brygder -------------------------------------------------------------- */

.brews {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48em) {
  .brews { grid-template-columns: repeat(3, 1fr); }
}

.brew {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 3 / 4;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(35, 36, 40, 0.9);
  background: var(--surface-low);
  overflow: hidden;
}

.brew > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.25);
  opacity: 0.68;
  transition: transform 0.7s ease, opacity 0.7s ease;
}
.brew:hover > img { transform: scale(1.05); opacity: 0.85; }

.brew::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface) 5%, rgba(12, 13, 16, 0.45) 45%, transparent 100%);
  pointer-events: none;
}

.brew-body { position: relative; z-index: 1; }

.brew-tag {
  margin-bottom: 0.35rem;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--primary);
}

.brew-body h3 { margin-bottom: 0.35rem; }

.brew-body p:last-child {
  font-size: 0.8125rem;
  color: rgba(142, 140, 137, 0.95);
  line-height: 1.55;
}

/* --- Vision / manifest ---------------------------------------------------- */

.marks {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
}

.marks li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.marks li::before {
  content: '';
  flex: none;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.6rem;
  border-radius: 50%;
  background: rgba(255, 193, 116, 0.6);
}

.manifest {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 32rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 1.5rem + 5vw, 4rem);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(35, 36, 40, 0.8);
  background: rgba(18, 19, 22, 0.4);
}

.manifest > img {
  width: 5rem;
  height: 5rem;
  margin-bottom: 2rem;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.8;
}

.manifest blockquote { margin-bottom: 1.5rem; }

.manifest hr {
  width: 3rem;
  height: 1px;
  margin: 0.5rem 0 1.25rem;
  border: 0;
  background: rgba(122, 118, 114, 0.5);
}

.coords {
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

/* --- Kontakt -------------------------------------------------------------- */

.contact {
  display: grid;
  gap: clamp(2.5rem, 2rem + 4vw, 5rem);
  align-items: start;
}

@media (min-width: 62em) {
  .contact { grid-template-columns: 5fr 7fr; }
}

.contact-details {
  display: grid;
  gap: 1.5rem;
  margin: 0;
}

@media (min-width: 40em) {
  .contact-details { grid-template-columns: repeat(3, 1fr); }
}

.contact-details dt {
  margin-bottom: 0.5rem;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 193, 116, 0.75);
}

.contact-details dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 300;
}

.contact-details a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 193, 116, 0.4);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.contact-details a:hover { color: var(--primary); border-color: var(--primary); }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--surface-lowest);
  border-top: 1px solid rgba(35, 36, 40, 0.8);
  padding-block: 4rem;
  color: var(--on-surface-variant);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 40em) {
  .footer-inner { flex-direction: row; text-align: left; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 300;
  color: rgba(227, 226, 230, 0.8);
}

.footer-brand img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.7;
  flex: none;
}

.footer-note {
  margin: 0;
  font-family: var(--font-label);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(142, 140, 137, 0.65);
}

/* --- Intoning ------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
}
