/* ============================================================
   REHAN HALAI — EDITORIAL / ARCHIVE PORTFOLIO
   Design system + layout
   ============================================================ */

/* --- DESIGN TOKENS --- */
:root {
  --bg: #EFE6D7;
  --bg-panel: #E5DAC9;
  --ink: #2f2a24;
  --ink-secondary: #4a3d34;   
  --ink-tertiary: #6b5c50;    
  --border: rgba(47, 42, 36, 0.25);
  --accent: #7C2A1C; /* Muted Vintage Newspaper Red */

  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code',
    Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --header-height: 52px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* Lenis Smooth Scrolling */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

body {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: 
    radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, rgba(47,42,36,0.06) 100%),
    linear-gradient(rgba(255,255,255,0.03), rgba(0,0,0,0.03));
  text-shadow: 0 0.2px rgba(47, 42, 36, 0.18);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -moz-osx-font-smoothing: grayscale;
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-decoration: none;
  z-index: 1000;
  border-radius: 0 0 2px 2px;
}

.skip-link:focus {
  top: 0;
}

/* --- LINKS --- */
a {
  color: var(--ink);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

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

/* Underline fade-in on hover */
.link-hover {
  position: relative;
  display: inline;
}

.link-hover::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  opacity: 0;
  transition: opacity 150ms ease;
}

.link-hover:hover::after {
  opacity: 1;
}

/* --- FOCUS --- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Remove default outline for non-keyboard users */
:focus:not(:focus-visible) {
  outline: none;
}

/* --- HEADER / TOP BAR --- */
site-header, site-footer {
  display: contents;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 var(--space-8);
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.header__nav {
  display: flex;
  gap: var(--space-6);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header__nav a {
  color: var(--ink);
  text-decoration: none;
}

.status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent);
  flex-shrink: 0;
}

.status-time {
  color: var(--ink-tertiary);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  margin-left: var(--space-2);
}

/* --- MAIN LAYOUT --- */
.site-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-12);
}

.columns {
  display: grid;
  grid-template-columns: 22% 46% 32%;
  gap: 0;
  min-height: calc(100vh - var(--header-height));
}

/* Each column */
.col {
  padding: var(--space-4) var(--space-6) var(--space-8);
}

/* --- LEFT COLUMN (PROFILE) --- */
.col--profile {
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding-right: var(--space-8);
  /* Grain texture applied via inline SVG background — see HTML */
  position: relative;
}

.col--profile::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.col--profile > * {
  position: relative;
  z-index: 1;
}

/* --- CENTER COLUMN (WORK) --- */
.col--work {
  border-right: 1px solid var(--border);
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

.hero-content {
  text-align: left;
}

.hero-title {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 6.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

.hero-art-container {
  margin-top: var(--space-6);
  max-width: 620px;
}

.hero-art-svg {
  width: 100%;
  height: auto;
  color: var(--ink-tertiary);
  opacity: 0.8;
  display: block;
}

.hero-art-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.hero-art-label {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--ink-tertiary);
  letter-spacing: 0.05em;
}

.hero-description {
  margin-top: var(--space-8);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 500px;
}

.hero-description p {
  margin-bottom: var(--space-4);
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.hero-art-svg path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 3.5s cubic-bezier(0.2, 1, 0.2, 1) forwards;
}

.hero-art-svg path:nth-child(1) { animation-delay: 0.1s; }
.hero-art-svg path:nth-child(2) { animation-delay: 0.3s; }
.hero-art-svg path:nth-child(3) { animation-delay: 0.5s; }
.hero-art-svg path:nth-child(4) { animation-delay: 0.2s; }
.hero-art-svg path:nth-child(5) { animation-delay: 0.4s; }

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* --- RIGHT COLUMN (ARCHIVE) --- */
.col--archive {
  padding-left: var(--space-8);
}

/* --- SECTION LABELS --- */
.section-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

/* --- PROFILE CONTENT --- */
.bio {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
  margin-bottom: var(--space-8);
}

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

.contact-list a {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
}

/* --- WORK CONTENT --- */
.work-entry {
  margin-bottom: var(--space-8);
}

.work-entry__number {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-tertiary);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.work-entry__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.work-entry__desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: var(--space-8) 0;
}

.section-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 0;
  width: 100%;
}

.inline-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-4);
}

.problems-list {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--ink-secondary);
}

.approach-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: var(--space-2);
}

.approach-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
}

.approach-step__num {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-tertiary);
  letter-spacing: 0.06em;
}

.approach-step__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}

.approach-arrow {
  font-size: 0.875rem;
  color: var(--ink-tertiary);
  flex-shrink: 0;
  text-align: center;
}

/* --- ARCHIVE CONTENT --- */
.portrait {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: var(--space-8);
  filter: grayscale(20%);
}

.archive-section {
  margin-bottom: var(--space-8);
}

.archive-section__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-3);
}

.archive-section__content {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink);
}

.archive-section__content .meta {
  font-size: 0.8125rem;
  color: var(--ink-tertiary);
}

.archive-section__content p {
  margin-bottom: var(--space-1);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 48px;
  grid-auto-flow: dense;
  gap: var(--space-2);
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 150ms ease;
}

.stack-item:hover {
  border-color: var(--ink-tertiary);
}

/* Size variants */
.stack-item--lg { grid-row: span 2; grid-column: span 2; }
.stack-item--tall { grid-row: span 2; }
.stack-item--wide { grid-column: span 2; }

.stack-icon {
  width: auto;
  height: 24px;
  max-width: 80%;
  object-fit: contain;
  flex-shrink: 0;
}

.stack-item--lg .stack-icon {
  height: 52px;
}

.stack-item--tall .stack-icon {
  height: 44px;
}

.stack-item--wide .stack-icon {
  height: 24px;
  max-width: 85%;
}

.stack-item span {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--ink-tertiary);
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- SCROLL FADE-IN --- */
.fade-entry {
  opacity: 0;
  transition: opacity 500ms ease;
}

.fade-entry.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .fade-entry {
    opacity: 1;
    transition: none;
  }
}

/* --- NEWSPAPER CLIPPING --- */
.newspaper-clipping {
  margin-bottom: var(--space-8);
}

.newspaper-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-tertiary);
  margin-bottom: var(--space-2);
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
}

.newspaper-author-img {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: var(--space-4) auto;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1) sepia(15%);
  border: 1px solid var(--border);
  padding: 3px;
}

.newspaper-headline {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  margin-bottom: var(--space-3);
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.newspaper-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.6;
  text-align: justify;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.newspaper-text:last-child {
  margin-bottom: 0;
}

.drop-cap {
  float: left;
  font-size: 3.6rem;
  line-height: 0.8;
  padding-top: 5px;
  padding-right: 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: bold;
  color: var(--ink);
}


/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  .header {
    padding: 0 var(--space-4);
    height: 48px;
    --header-height: 48px;
  }

  .wordmark {
    font-size: 0.8125rem;
  }

  .wordmark__secondary {
    display: none;
  }

  .wordmark__secondary {
    display: none;
  }

  .status {
    display: none;
  }

  .header__nav {
    gap: var(--space-4);
    font-size: 0.75rem;
  }

  .site-container {
    padding: 0 var(--space-4);
  }

  .columns {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .col {
    position: static;
    height: auto;
    overflow-y: visible;
    padding: var(--space-6) var(--space-4);
  }

  .col--profile {
    display: none !important;
  }

  .col--archive {
    order: 1;
    border-bottom: 1px solid var(--border);
    padding: var(--space-6) var(--space-4);
  }

  .col--work {
    order: 2;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-6) var(--space-4);
  }

  .portrait-placeholder {
    max-width: 200px;
    max-height: 240px;
  }

  .hero-title {
    font-size: clamp(3.2rem, 12vw, 4rem);
  }
}

/* --- MEDIUM SCREENS (769–1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .columns {
    grid-template-columns: 26% 42% 32%;
  }

  .header {
    padding: 0 var(--space-6);
  }

  .site-container {
    padding: 0 var(--space-6);
  }

  .hero-title {
    font-size: clamp(2.8rem, 4.5vw, 4.5rem);
  }
}

/* --- FOOTER --- */
.footer {
  margin-top: var(--space-12);
  padding-bottom: var(--space-8);
}

.footer__banner {
  margin: 0 calc(50% - 50vw);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: var(--space-8) 0;
  overflow: hidden;
  position: relative;
}

.footer__marquee-container {
  display: flex;
  width: 100%;
  overflow: hidden;
}

.footer__marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  font-family: "Times New Roman", Times, serif;
  font-size: 5.5rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
}

.marquee-text {
  padding: 0 3rem;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.footer__cta {
  position: relative;
  font-family: "Times New Roman", Times, serif;
  font-size: 4.5rem;
  font-weight: 400;
  letter-spacing: -0.05em;
  background-color: var(--ink);
  color: var(--bg);
  padding: 0 var(--space-2);
  text-decoration: none;
  display: inline-block;
  transform: translateY(-4px); /* Optical alignment */
  transition: all 200ms ease;
  line-height: 1.1;
  flex-shrink: 0;
}

.footer__cta:hover {
  background-color: var(--accent);
  color: var(--ink);
}

.cta-icon {
  position: absolute;
  bottom: -13px;
  right: -40px;
  width: 0.7em;
  height: 0.7em;
  color: var(--ink);
  transition: transform 150ms ease;
}

.footer__cta:hover .cta-icon {
  transform: scale(1.1) rotate(5deg);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-6) var(--space-4) 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.footer__legal {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.footer__logo {
  font-weight: 600;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.125rem;
  letter-spacing: 0;
}

.footer__meta {
  color: var(--ink-secondary);
}

.footer__links {
  display: flex;
  gap: var(--space-2);
  color: var(--ink-tertiary);
}

.footer__links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .footer__marquee-track {
    font-size: 4rem;
  }
  .footer__cta {
    font-size: 3.25rem;
  }
}

@media (max-width: 768px) {
  .footer__marquee-track {
    font-size: 2.5rem;
  }
  .footer__cta {
    font-size: 2rem;
  }
  .cta-icon {
    bottom: -8px;
    right: -24px;
  }
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
  }
}