/* ============================================
   Cohen Design Studio — shared stylesheet
   ============================================ */

/* Custom fonts — files sit alongside this stylesheet */
@font-face {
  font-family: 'Lemon Milk';
  src: url('LEMONMILK-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Neue LT Pro';
  src: url('HelveticaNeueLTProLt.otf') format('opentype');
  font-weight: 350;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono still loaded from Google Fonts for small labels */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Colour palette — warm editorial */
  --bg:          #f5f1ea;
  --bg-soft:     #ebe4d7;
  --ink:         #1a1815;
  --ink-soft:    #4a4640;
  --ink-mute:    #8a8378;
  --rule:        #d4ccc0;
  --accent:      #b8763d;
  --accent-deep: #8f5828;

  /* Fonts */
  --display: 'Lemon Milk', 'Helvetica Neue', Arial, sans-serif;
  --body:    'Helvetica Neue LT Pro', 'Helvetica Neue', Arial, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --shell: 960px;
  --prose: 660px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(184,118,61,0.05) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(26,24,21,0.04) 0%, transparent 55%);
}

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

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.prose, main > p, main > h2, main > h3, main > .eyebrow, main > .lead, main > .meta {
  max-width: var(--prose);
  margin-left: auto;
  margin-right: auto;
}

/* -------- Navigation -------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4rem;
  max-width: var(--prose);
  margin-left: auto;
  margin-right: auto;
}

.nav__brand {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s;
}

.nav__links a:hover { color: var(--ink); }

.nav__links a.is-current { color: var(--ink); }
.nav__links a.is-current::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--accent);
}

/* -------- Dropdown Navigation -------- */
.nav__item--dropdown {
  position: relative;
  padding-bottom: 0.5rem; 
  margin-bottom: -0.5rem;
}

.dropdown {
  /* Switch from display: none to visibility/opacity for smooth transitions */
  visibility: hidden;
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  
  position: absolute;
  top: 100%;
  left: -0.75rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  min-width: 200px;
  z-index: 10;
  border-radius: 2px;
  box-shadow: 0 4px 6px rgba(26, 24, 21, 0.04);

  list-style: none;
  
  /* Adds a 0.25-second delay before hiding when the mouse leaves */
  transition: opacity 0.2s ease, visibility 0.2s ease 0.25s;
}

/* Creates an invisible bridge to cover the hover gap */
.dropdown::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 0;
  right: 0;
  height: 15px;
}

.nav__item--dropdown:hover .dropdown {
  visibility: visible;
  opacity: 1;
  /* Removes the delay when hovering so it opens instantly */
  transition: opacity 0.2s ease, visibility 0s; 
}

.dropdown a {
  display: block;
  padding: 0;
}

/* Remove the brown underline from the "Work" dropdown parent link */
.nav__links .nav__item--dropdown > a.is-current::after,
.dropdown a.is-current::after {
  display: none; 
}

/* Mobile adjustments for the dropdown */
@media (max-width: 600px) {
  .dropdown {
    position: static;
    border: none;
    box-shadow: none;
    padding: 0.5rem 0 0 0.5rem;
    margin-top: 0.25rem;
    min-width: auto;
    background: transparent;
    /* Ensure it remains visible in the mobile stack */
    visibility: visible;
    opacity: 1;
  }
  
  .dropdown::before {
    display: none;
  }
}

/* -------- Typography -------- */
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.75rem;
  color: var(--ink);
}

h1 em {
  font-style: normal;
  color: var(--accent-deep);
}

h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: 0.005em;
  margin: 3.5rem 0 1.25rem;
}

/* h3 in a tighter, technical sub-section style — Helvetica with tracking */
h3 {
  font-family: var(--body);
  font-weight: 300;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin: 2.25rem 0 0.75rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  margin-bottom: 1.25rem;
  display: block;
}

.meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  margin-bottom: 2.5rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--ink-soft);
}

p.lead {
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 2rem;
  line-height: 1.55;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

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

/* -------- Figures & image grids -------- */
figure {
  margin: 3rem 0;
}

figure img {
  width: 100%;
  border-radius: 2px;
  background: var(--bg-soft);
}

figure figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-top: 0.75rem;
  text-align: center;
}

.fig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3rem 0;
}

.fig-grid figure { margin: 0; }

/* -------- Contact rows -------- */
.contact-list { list-style: none; margin: 2rem auto; max-width: var(--prose); }

.contact-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}

.contact-row:last-child { border-bottom: 1px solid var(--rule); }

.contact-row__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}

.contact-row__value { color: var(--ink); }

/* -------- Tag list (skills/tools) -------- */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem auto 2rem;
  max-width: var(--prose);
}

.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--rule);
}

/* -------- Footer -------- */
.foot {
  margin: 5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--prose);
}

/* -------- Entry animation -------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

main > *, main figure {
  animation: rise 0.6s cubic-bezier(0.2, 0.6, 0.2, 1) backwards;
}
main > *:nth-child(1)  { animation-delay: 0.05s; }
main > *:nth-child(2)  { animation-delay: 0.11s; }
main > *:nth-child(3)  { animation-delay: 0.17s; }
main > *:nth-child(4)  { animation-delay: 0.23s; }
main > *:nth-child(5)  { animation-delay: 0.29s; }
main > *:nth-child(6)  { animation-delay: 0.35s; }
main > *:nth-child(n+7){ animation-delay: 0.41s; }


/* -------- Mobile -------- */
@media (max-width: 600px) {
  .shell { padding: 2rem 1.25rem 4rem; }
  .nav { margin-bottom: 3rem; padding-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
  .nav__links { gap: 1.25rem; }
  h2 { margin-top: 2.5rem; }
  figure { margin: 2rem 0; }
  .fig-grid { grid-template-columns: 1fr; gap: 1rem; margin: 2rem 0; }
  .contact-row { grid-template-columns: 1fr; gap: 0.25rem; padding: 1rem 0; }
  
  /* Mobile Dropdown Updates */
  .dropdown {
    /* Set to absolute so it floats over the page and doesn't push siblings */
    position: absolute;
    top: 100%;
    left: -0.75rem;
    background: var(--bg);
    border: 1px solid var(--rule);
    box-shadow: 0 4px 6px rgba(26, 24, 21, 0.04);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    min-width: 180px;
    z-index: 20;
    border-radius: 2px;
    
    /* Hide the menu by default on mobile */
    display: none; 
  }
  
  .dropdown::before {
    display: none;
  }

  /* This class will be added by JavaScript when tapped */
  .dropdown.is-open {
    display: flex;
  }
}

/* Remove the brown underline from the "Work" dropdown parent link */
.nav__links .nav__item--dropdown > a.is-current::after {
  display: none;
}