/* ==========================================================================
   Jakob Rosin — jakobrosin.com
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  --color-bg: #faf8f5;
  --color-bg-alt: #f2efe9;
  --color-surface: #ffffff;
  --color-text: #2c2a26;
  --color-text-muted: #5c584f;
  --color-heading: #1a1815;
  --color-accent: #c06830;
  --color-accent-hover: #a3572a;
  --color-accent-light: #f5e6da;
  --color-link: #b05a28;
  --color-link-hover: #8a4520;
  --color-border: #e0dbd3;
  --color-focus: #c06830;
  --color-hero-overlay: rgba(26, 24, 21, 0.52);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-base: 1.0625rem;
  --font-size-sm: 0.9375rem;
  --font-size-xs: 0.8125rem;
  --font-size-lg: 1.1875rem;
  --font-size-h1: 3rem;
  --font-size-h2: 1.875rem;
  --font-size-h3: 1.375rem;

  --line-height-body: 1.7;
  --line-height-heading: 1.2;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --max-width: 52rem;
  --nav-height: 3.75rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --- Focus Styles --- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Skip Navigation --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 1000;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s;
}

.skip-link:focus {
  top: var(--space-sm);
}

/* --- Screen Reader Only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Header & Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-home {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--color-heading);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-home:hover {
  color: var(--color-accent);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--color-text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  display: block;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.375rem 0.75rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius);
  transition: color 0.15s, background-color 0.15s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.nav-links a[aria-current="page"] {
  color: var(--color-accent);
  font-weight: 600;
}

.nav-links .external-icon {
  width: 0.75em;
  height: 0.75em;
  opacity: 0.5;
  flex-shrink: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  width: 100%;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 24, 21, 0.78) 0%,
    rgba(26, 24, 21, 0.45) 50%,
    rgba(26, 24, 21, 0.2) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  width: 100%;
}

.hero h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  color: #fff;
  line-height: var(--line-height-heading);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-tagline {
  font-size: var(--font-size-lg);
  color: #fff;
  line-height: 1.5;
  max-width: 36rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* --- Main Content --- */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

/* --- Section --- */
.section {
  margin-bottom: var(--space-2xl);
}

.section:last-child {
  margin-bottom: 0;
}

.section > h2 {
  font-size: var(--font-size-h2);
  font-weight: 750;
  color: var(--color-heading);
  line-height: var(--line-height-heading);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.015em;
}

.section > h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-top: var(--space-sm);
}

/* --- Subsection --- */
.subsection {
  margin-bottom: var(--space-lg);
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection h3 {
  font-size: var(--font-size-h3);
  font-weight: 650;
  color: var(--color-heading);
  line-height: var(--line-height-heading);
  margin-bottom: var(--space-sm);
}

/* --- Typography --- */
p {
  margin-bottom: var(--space-md);
}

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

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.15s;
}

a:hover {
  color: var(--color-link-hover);
}

/* --- Video Embed --- */
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--color-bg-alt);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-lg);
}

/* --- CTA Link / Button-style links --- */
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  font-size: var(--font-size-base);
}

.cta-link .arrow {
  transition: transform 0.2s;
}

.cta-link:hover .arrow {
  transform: translateX(3px);
}

/* --- Contact Page --- */
.contact-intro {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  max-width: 36rem;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.contact-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-light);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-accent);
}

.contact-detail {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-detail a {
  font-weight: 500;
}

/* --- Page Header (for non-hero pages) --- */
.page-header {
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.page-header h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  color: var(--color-heading);
  line-height: var(--line-height-heading);
  letter-spacing: -0.02em;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: var(--space-lg) var(--space-md);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo img {
  height: 30px;
  width: auto;
  opacity: 0.65;
  transition: opacity 0.2s;
}

.footer-logo a:hover img {
  opacity: 1;
}

.footer-copy {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* --- Responsive --- */
@media (max-width: 48rem) {
  :root {
    --font-size-h1: 2.25rem;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.25rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }

  /* Mobile nav */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-md) var(--space-md);
    gap: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 0.75rem;
    font-size: var(--font-size-base);
    border-radius: var(--radius);
  }

  .hero {
    min-height: 50vh;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 30rem) {
  :root {
    --font-size-h1: 1.875rem;
    --font-size-h2: 1.375rem;
    --space-xl: 2.5rem;
    --space-2xl: 3rem;
  }

  .hero {
    min-height: 45vh;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .hero-tagline {
    font-size: var(--font-size-base);
  }

  .page-header h1 {
    font-size: 1.875rem;
  }
}

/* --- Print --- */
@media print {
  .site-header,
  .skip-link,
  .nav-toggle {
    display: none;
  }

  .hero {
    min-height: auto;
    background: none;
  }

  .hero-overlay {
    display: none;
  }

  .hero-content {
    padding: var(--space-md) 0;
  }

  .hero h1,
  .hero-tagline {
    color: var(--color-text);
  }

  body {
    font-size: 12pt;
  }
}
