/* ============================================================
   Tessercode — stylesheet
   Palette: Warm Minimal (approachable + academic)
   ============================================================ */

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

:root {
  --bg:           #faf8f5;
  --surface:      #ffffff;
  --accent:       #9c4221;
  --accent-mid:   #b45309;
  --accent-light: #fef3e2;
  --accent-xlight:#fffbf0;
  --text:         #292524;
  --text-muted:   #78716c;
  --border:       #e7e5e4;
  --hero-bg:      #292524;
  --radius:       8px;
  --radius-lg:    14px;
  --max-width:    1080px;
  --nav-height:   80px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-mid);
  margin-bottom: 0.6rem;
}

.section-label.centered,
.centered {
  text-align: center;
}

.section-intro {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 0.75rem;
}

.section-intro.centered {
  margin-left: auto;
  margin-right: auto;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.nav.scrolled {
  box-shadow: 0 2px 16px rgba(41, 37, 36, 0.08);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand:hover {
  text-decoration: none;
  opacity: 0.82;
}

.nav-logo {
  height: 52px;
  width: auto;
  display: block;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

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

.nav-link-about {
  background: var(--accent-light) !important;
  color: var(--accent) !important;
  font-weight: 600 !important;
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-mid);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
  color: #fff;
  text-decoration: none;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  background: var(--hero-bg);
  color: #fff;
  padding: 110px 2rem 120px;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 580px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   SECTION WRAPPER
   ============================================================ */

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 88px 2rem;
}

/* ============================================================
   ABOUT
   ============================================================ */

.about {
  background: var(--surface);
}

.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* Photo */
.about-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-photo {
  width: 180px;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border);
}

.about-photo-placeholder {
  width: 180px;
  height: 220px;
  background: var(--accent-xlight);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  position: relative;
}

.about-photo-placeholder::after {
  content: "Photo";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Content */
.about-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.about-content > p {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.about-content > p:last-of-type {
  margin-bottom: 2rem;
}

/* Detail rows */
.about-details {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-bottom: 2rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  align-items: baseline;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.detail-row a {
  color: var(--accent);
}

.detail-row a:hover {
  color: var(--accent-mid);
}

/* Profile link chips */
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.link-chip {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid #f0d5b8;
  transition: background 0.15s, border-color 0.15s;
}

.link-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ============================================================
   COMING SOON
   ============================================================ */

.coming {
  background: var(--bg);
}

.coming .section-inner {
  padding-top: 80px;
  padding-bottom: 96px;
}

.coming h2 {
  font-size: 2rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.coming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.coming-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.coming-card:hover {
  box-shadow: 0 4px 24px rgba(156, 66, 33, 0.1);
  transform: translateY(-2px);
}

.coming-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--accent);
}

.coming-icon svg {
  width: 22px;
  height: 22px;
}

.coming-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.coming-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.coming-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-xlight);
  color: var(--accent-mid);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #f0d5b8;
}

/* Active card link (replaces coming-badge on live sections) */
.coming-card--live {
  text-decoration: none;
  color: inherit;
  border-color: var(--accent);
  display: block; /* override <a> inline */
}

.coming-card--live:hover {
  text-decoration: none;
}

.coming-card-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.page-header .section-intro {
  max-width: none;
}

/* ============================================================
   RESEARCH PAGE
   ============================================================ */

.research-section {
  background: var(--bg);
}

.research-entries {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.research-entry {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.research-entry:hover {
  box-shadow: 0 4px 24px rgba(156, 66, 33, 0.1);
  transform: translateY(-2px);
}

.research-entry-media {
  background: var(--accent-xlight);
}

.research-entry-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.research-entry-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.35;
}

.research-entry-img-placeholder svg {
  width: 52px;
  height: 52px;
}

.research-entry-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.research-entry-title {
  font-size: 1.35rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.research-entry-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.research-entry-body > p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.research-entry-body > p:last-of-type {
  margin-bottom: 0;
}

.research-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

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

.footer {
  background: var(--hero-bg);
  color: rgba(255, 255, 255, 0.55);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.3rem;
}

.footer-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1.25rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

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

@media (max-width: 768px) {
  /* Nav */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 8px 24px rgba(41, 37, 36, 0.1);
  }

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

  .nav-links li a {
    padding: 0.65rem 0.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* Hero */
  .hero {
    padding: 72px 1.5rem 80px;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo-wrap {
    align-items: flex-start;
  }

  .about-photo,
  .about-photo-placeholder {
    width: 130px;
    height: 160px;
  }

  /* Detail rows */
  .detail-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  /* Section padding */
  .section-inner {
    padding: 56px 1.5rem;
  }

  /* Research entries */
  .research-entry-body {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .coming-grid {
    grid-template-columns: 1fr 1fr;
  }
}
