/* ============================================
   LORE STUDIO
   ============================================ */

@font-face {
  font-family: 'Suisse Intl';
  src: url('/fonts/SuisseIntl-Regular-WebS.woff2') format('woff2'),
       url('/fonts/SuisseIntl-Regular-WebS.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

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

:root {
  /* Brand Colors */
  --color-dark-grey: #141414;
  --color-warm-off-white: #e5e4df;

  /* Semantic Colors - Dark mode (default) */
  --color-bg: var(--color-dark-grey);
  --color-bg-hover: rgba(255, 255, 255, 0.05);
  --color-text: var(--color-warm-off-white);
  --color-border: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-family: 'Suisse Intl', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Spacing */
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  /* Opacity */
  --opacity-muted: 0.55;
  --opacity-subtle: 0.6;

  /* Transitions */
  --duration-fast: 0.2s;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg: var(--color-warm-off-white);
    --color-bg-hover: rgba(20, 20, 20, 0.05);
    --color-text: var(--color-dark-grey);
    --color-border: rgba(20, 20, 20, 0.1);
  }
}

html {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.lenis,
html.lenis body {
  height: auto;
}

/* Text wrapping */
h1, h2, h3,
.hero-title, .brand-name {
  text-wrap: balance;
}

p, .origin-statement, .brand-desc {
  text-wrap: pretty;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Nav gradient fade */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    to bottom,
    var(--color-bg) 0%,
    color-mix(in srgb, var(--color-bg) 60%, transparent) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 99;
}

::selection {
  background-color: var(--color-text);
  color: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.ui-text {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1rem;
  text-transform: uppercase;
}

/* ============================================
   NAVIGATION
   ============================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  z-index: 200;
  transition: top 0.2s;
}

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

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
}

.nav-logo img {
  height: 16px;
  width: auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link,
.footer-link {
  opacity: var(--opacity-subtle);
  transition: opacity var(--duration-fast);
}

.nav-link:hover,
.footer-link:hover {
  opacity: 1;
}

.nav-link:focus-visible,
.footer-link:focus-visible {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Logo theme switching */
.logo-light { display: block; }
.logo-dark { display: none; }

@media (prefers-color-scheme: light) {
  .logo-light { display: none; }
  .logo-dark { display: block; }
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
}

.footer-copyright {
  opacity: var(--opacity-muted);
}

.footer-nav {
  display: flex;
  gap: var(--space-md);
}

/* ============================================
   HERO (shared)
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* ============================================
   HOME PAGE
   ============================================ */

.hero:not(.error-page .hero) {
  position: relative;
  justify-content: center;
  overflow: hidden;
}

.hero:not(.error-page .hero) .hero-content {
  flex: 1;
  justify-content: center;
}

.hero:not(.error-page .hero) .hero-title {
  font-size: clamp(2.5rem, 10vw, 8rem);
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}

.title-line {
  display: block;
  overflow: hidden;
}

.title-word {
  display: inline-block;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem;
  cursor: pointer;
}

.scroll-line {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-text), transparent);
  opacity: 0.4;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(8px); opacity: 0.2; }
}

/* Origin section */
.origin {
  padding: var(--space-2xl) var(--space-lg);
}

.origin-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.origin-statement {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Portfolio grid */
.portfolio {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.brand-item {
  padding: var(--space-xl) var(--space-lg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  transition: background 0.3s;
}

.brand-item:nth-child(2n) {
  border-right: none;
}

.brand-item:nth-last-child(n+3) {
  border-bottom: 1px solid var(--color-border);
}

.brand-item:hover {
  background: var(--color-bg-hover);
}

.brand-item--intro {
  justify-content: center;
}

.brand-item--intro .brand-name {
  margin-top: 0;
}

.brand-item--intro .brand-desc {
  max-width: 400px;
}

.brand-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: auto;
}

.brand-category,
.brand-number {
  opacity: var(--opacity-muted);
}

.brand-name {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: var(--space-lg) 0 var(--space-md);
  text-transform: uppercase;
}

.brand-desc {
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: var(--opacity-subtle);
  max-width: 420px;
  margin-bottom: var(--space-lg);
}

.brand-cta {
  margin-top: auto;
  opacity: var(--opacity-muted);
  transition: opacity var(--duration-fast);
}

.brand-item:hover .brand-cta {
  opacity: 1;
}

.brand-item:not(.brand-item--intro) .brand-name {
  transition: transform 0.4s var(--ease-out-expo);
}

.brand-item:not(.brand-item--intro):hover .brand-name {
  transform: translateX(10px);
}

/* ============================================
   404 PAGE
   ============================================ */

.error-page .hero {
  justify-content: center;
}

.error-page .hero-label {
  letter-spacing: 0.2em;
}

.error-page .hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  margin-bottom: var(--space-md);
}

.error-page .hero-text {
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

.error-page .hero-link {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  transition: background 0.2s;
}

.error-page .hero-link:hover {
  background: var(--color-bg-hover);
}

/* ============================================
   WORD REVEAL STYLING
   ============================================ */

.origin-statement .word {
  display: inline-block;
  margin-right: 0.25em;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

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

  .title-word,
  [data-brand],
  .origin-statement .word,
  .scroll-indicator,
  .error-page .hero-label,
  .error-page .hero-title,
  .error-page .hero-text,
  .error-page .hero-link {
    opacity: 1 !important;
    transform: none !important;
  }

  .error-page .hero-label {
    opacity: 0.5 !important;
  }

  .scroll-line {
    animation: none !important;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .portfolio {
    grid-template-columns: 1fr;
  }

  .brand-item {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .nav,
  .hero,
  .brand-item,
  .footer {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .brand-item {
    min-height: 300px;
  }

  .footer {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .nav,
  .footer,
  .skip-link,
  .brand-cta,
  .scroll-indicator {
    display: none !important;
  }

  body,
  .hero,
  .brand-item,
  .origin {
    background: white !important;
    color: black !important;
  }

  .hero {
    min-height: auto !important;
    padding: 2rem 0 !important;
  }

  .hero-title {
    font-size: 24pt !important;
    color: black !important;
  }

  .origin-statement {
    font-size: 14pt !important;
  }

  .brand-item {
    border: none !important;
    padding: 1rem 0 !important;
    min-height: auto !important;
    page-break-inside: avoid;
  }

  .brand-name {
    font-size: 18pt !important;
    margin: 0.5rem 0 !important;
    transform: none !important;
  }

  .brand-desc {
    opacity: 1 !important;
    max-width: none !important;
  }

  /* Ensure links are readable */
  a {
    text-decoration: none !important;
    color: black !important;
  }

  /* Show URL after links (optional, but good for print) */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
}
