/* ================================================================
   @font-face
   ================================================================ */

/* TODO: add fonts/Recoleta-Regular.woff2 once licensed */
@font-face {
  font-family: 'Recoleta';
  src: url('fonts/Recoleta-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Routed Gothic Wide';
  src: url('fonts/routed-gothic-wide.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-LightItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-RegularItalic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
/* Bold and Black declared for completeness; not used in the design */
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Runda';
  src: url('fonts/Runda-BlackItalic.woff2') format('woff2');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}


/* ================================================================
   Custom properties
   ================================================================ */

:root {
  /* Background palette — warm off-white family */
  --color-hero:         #FAF7F2; /* hero and nav — warmer, more yellow */
  --color-base:         #FAF7F2; /* about, location, contact */
  --color-warm:         #F7F2EA; /* building, history */
  --color-cool:         #F5F2ED; /* spaces */
  --color-deep:         #F2EEE6; /* reserved */

  /* Text and chrome */
  --color-text:         #1A1A1A;
  --color-rule:         rgba(0, 0, 0, 0.08);
  --color-rule-strong:  rgba(0, 0, 0, 0.12);

  /* Footer */
  --color-footer-bg:    #2A1F18;
  --color-footer-text:  #EDE3D6;

  /* Type families */
  --font-serif: 'Routed Gothic Wide', sans-serif;
  --font-sans:  'Runda', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Type scale */
  --text-title:  clamp(3rem, 5vw, 4.5rem);  /* 48–72px, section titles and hero */
  --text-body:   1rem;                       /* 16px, all body content */

  /* Layout */
  --max-width:      1200px;
  --text-max-width: 680px;
  --side-padding:   clamp(16px, 4vw, 80px);
  --nav-height:     72px;

  /* Motion */
  --ease-standard:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-hover:  200ms;
  --duration-nav:    350ms;
  --duration-fade:   600ms;
}


/* ================================================================
   Reset
   ================================================================ */

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  /* native smooth scroll as baseline; JS overrides for header offset */
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-base);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  overflow-x: clip;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}


/* ================================================================
   Navigation
   ================================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--color-hero); /* matches hero; never changes on scroll */
  /* hairline starts invisible; fades to solid black on scroll */
  border-bottom: 1px solid transparent;
  transition: border-color 250ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: hsl(0, 0%, 70%);
}

.nav {
  height: 100%;
  padding: 0 var(--side-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-body);
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 3rem;
}

.nav-link {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-body);
  letter-spacing: 0;
  font-style: italic;
  text-transform: none;
  position: relative;
  opacity: 1;
}

/* Draw-from-left underline. Default state is undrawn with no transition
   so deactivation and mouse-out snap to 0 instantly. */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 0;
  background-color: #1A1A1A;
  transition: none;
}

@media (hover: hover) and (pointer: fine) {
  .nav-link:hover::after {
    width: 100%;
    transition: width 300ms ease-out;
  }
}

.nav-link.is-active::after {
  width: 100%;
  transition: width 400ms ease-out;
}

/* Outgoing: hold width at 100%, fade opacity so there's no gap between sections */
.nav-link.is-leaving::after {
  width: 100%;
  opacity: 0;
  transition: opacity 300ms ease-out;
}


/* ================================================================
   Sections — shared structure
   ================================================================ */

.section {
  padding: 3rem var(--side-padding);
  /* development placeholder height; content will determine real height */
  min-height: 40vh;
}

/* Hero fills the viewport. Padding-top reserves space for the fixed nav.
   On desktop the image is centered in the remaining area; on mobile it
   is top-aligned so it can't slip behind the nav bar (see mobile override). */
.section--hero {
  height: 100vh;
  min-height: 0;
  padding: var(--nav-height) var(--side-padding) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Hero component */

.hero-inner {
  display: flex;
  flex-direction: column;
  margin-top: -50px;  /* Adjust the value to your preference */
}

.hero-image {
  display: block;
  height: 62vh;
  width: auto;
  max-width: 100%;
  opacity: 0;
  transition: opacity 400ms ease;
  will-change: transform;
}

.hero-image.is-loaded {
  opacity: 1;
}

/* Background colour per section */
.section--hero { background-color: var(--color-hero); }

.section--about,
.section--location,
.section--contact  { background-color: var(--color-base); }

.section--building,
.section--history  { background-color: var(--color-warm); }

.section--spaces   { background-color: var(--color-cool); }

/* Section label shown during development; remove once content is in place */
.section::after {
  content: '#' attr(id);
  display: block;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--color-rule-strong);
}

/* Suppress label on sections that have real content */
.section--hero::after { display: none; }


/* ================================================================
   Section content — layout and typography
   ================================================================ */

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-title);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.section-body p + p {
  margin-top: 1.25rem;
}

/* Building spec list and contact list share the same row pattern */
.spec-list,
.contact-list {
  border-top: 1px solid var(--color-rule);
}

.spec-row,
.contact-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.spec-list dt {
  width: 180px;
  flex-shrink: 0;
  opacity: 0.65;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-list {
  margin-top: 2rem;
}

.contact-list dt {
  width: 200px;
  flex-shrink: 0;
  opacity: 0.65;
}


/* Spaces availability table */
.spaces-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
}

.spaces-table th,
.spaces-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-rule);
}

.spaces-table th:not(:last-child),
.spaces-table td:not(:last-child) {
  padding-right: clamp(1rem, 3vw, 2.5rem);
}

.spaces-table th {
  font-weight: 500;
}

/* Spaces table — floor cell */
.spaces-td-floor strong {
  display: block;
  font-weight: 500;
}

/* Spaces table — columns that must not wrap */
.spaces-th-floor, .spaces-td-floor,
.spaces-th-sf, .spaces-td-sf,
.spaces-th-plan, .spaces-td-plan,
.spaces-th-avail, .spaces-td-avail {
  white-space: nowrap;
}

/* Spaces table — View Plan link */
.spaces-plan-link {
  opacity: 0.65;
}

/* Mobile-only View Plan link inside type cell; hidden on desktop */
.spaces-plan-link--mobile {
  display: none;
}

/* Spaces table — availability toggle */
.spaces-avail-wrap {
  position: relative;
  display: inline-block;
}

.spaces-avail-text,
.spaces-avail-inquire {
  transition: opacity 200ms ease;
}

.spaces-avail-text {
  font-weight: 500;
}

.spaces-avail-inquire {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .spaces-avail-link {
    pointer-events: none;
  }

  .spaces-avail-wrap:hover .spaces-avail-text {
    opacity: 0;
  }

  .spaces-avail-wrap:hover .spaces-avail-link {
    pointer-events: auto;
  }

  .spaces-avail-wrap:hover .spaces-avail-inquire {
    opacity: 1;
  }
}

/* Spaces table — availability cell */
.spaces-td-avail {
  font-weight: 500;
}

/* Availability column: right-aligned on desktop */
.spaces-th-avail,
.spaces-td-avail {
  text-align: right;
}

/* Spaces table — desktop grid: Floor flush left, Availability flush right, middle three equal */
@media (min-width: 601px) {
  .spaces-table {
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr auto;
  }
  .spaces-table thead,
  .spaces-table tbody,
  .spaces-table tr {
    display: contents;
  }
  .spaces-table th,
  .spaces-table td {
    align-self: start;
  }
}

/* Lucide icons in spec list */
.spec-icon {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Section figure — image within section margins */
.section-figure {
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.section-figure-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Two-column layout — building and history sections */
.section-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: stretch;
}

.section-two-col .section-figure {
  margin: 0;
  overflow: hidden;
}

.section-two-col .section-figure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Location map — Manhattan outline SVG */
.location-map {
  margin-bottom: 2rem;
  width: 80px;
}

.map-svg {
  width: 100%;
  height: auto;
}

.map-island {
  fill: rgba(0, 0, 0, 0.04);
  stroke: var(--color-text);
  stroke-width: 1.2;
  opacity: 0.6;
}

.map-dot {
  fill: var(--color-text);
}

.map-label {
  font-family: var(--font-sans);
  font-size: 5.5px;
  font-weight: 300;
  fill: var(--color-text);
  opacity: 0.65;
}

/* Transit label */
.transit-label {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-rule);
  opacity: 0.65;
}

/* Transit list */
.transit-list {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-rule);
  margin-bottom: 1.5rem;
}

.transit-station {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.25rem 0;
}

.transit-name {
  /* no min-width needed; white-space: nowrap keeps each station on one line */
}

.transit-badges {
  display: flex;
  gap: 3px;
  align-items: center;
}

.mta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  line-height: 1;
}

.mta-badge--lex { background-color: #00933C; }
.mta-badge--8av { background-color: #0039A6; }
.mta-badge--bwy { background-color: #FCCC0A; color: #1A1A1A; }

/* Location marquee */
.location-marquee {
  overflow: hidden;
  position: relative;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  margin-top: 2rem;
  transform: translateZ(0);
}

.location-marquee-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.marquee-item {
  font-family: var(--font-sans);
  white-space: nowrap;
  padding: 0 0.75rem;
  opacity: 0.65;
}

.marquee-sep {
  opacity: 0.25;
}


/* Spaces photo gallery */
.spaces-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 2.5rem;
}

.spaces-gallery-item {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.spaces-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* History — PDF link */
.history-pdf-link {
  opacity: 0.65;
  transition: opacity 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .history-pdf-link:hover {
    opacity: 1;
  }
}


/* Suppress dev label on sections that have real content */
.section--about::after,
.section--building::after,
.section--location::after,
.section--spaces::after,
.section--history::after,
.section--contact::after { display: none; }


/* ================================================================
   Footer
   ================================================================ */

.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  display: flex;
  align-items: center;
}

.footer-inner {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--side-padding);
}

.footer-year {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* ================================================================
   Mobile bottom nav — fixed bar, visible below 900px
   ================================================================ */

.bottom-nav {
  display: none;
  position: sticky;
  bottom: 0;
  width: 100%;
  z-index: 100;
  height: 56px;
  background-color: var(--color-base);
  border-top: 1px solid hsl(0, 0%, 70%);
}

.bottom-nav ul {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 0 var(--side-padding);
}

.bottom-nav li:nth-child(1) { justify-self: start;  text-align: left; }
.bottom-nav li:nth-child(2) { justify-self: center; text-align: center; }
.bottom-nav li:nth-child(3) { justify-self: end;    text-align: right; }

.bottom-nav-link {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-body);
  letter-spacing: 0;
  font-style: normal;
  text-transform: none;
  position: relative;
  opacity: 0.8;
}

.bottom-nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 0;
  background-color: #1A1A1A;
  transition: none;
}

@media (hover: hover) and (pointer: fine) {
  .bottom-nav-link:hover::after {
    width: 100%;
    transition: width 300ms ease-out;
  }
}

.bottom-nav-link.is-active::after {
  width: 100%;
  transition: width 400ms ease-out;
}

.bottom-nav-link.is-leaving::after {
  width: 100%;
  opacity: 0;
  transition: opacity 300ms ease-out;
}


/* ================================================================
   Scroll reveal
   ================================================================ */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease-standard), transform 600ms var(--ease-standard);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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


/* ================================================================
   Responsive — tablet (600–900px)
   ================================================================ */

@media (max-width: 600px) {
  :root {
    --nav-height: 64px;
  }

  /* Background-color added here so the transition only fires on mobile,
     where the hero and non-hero sections have different nav colors. */
  .site-header {
    transition: background-color 400ms ease, border-color 250ms ease;
  }

  /* Past the hero: match bottom nav exactly */
  .site-header.nav--scrolled {
    background-color: var(--color-base);
  }


  .hero-inner {
    width: 100%;
    align-self: stretch;
    position: relative;
    margin-top: 0;
    overflow: hidden;
  }

  .hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  .bottom-nav {
    display: block;
  }

  /* Section links move to bottom nav on mobile */
  .nav-links {
    display: none;
  }

  /* Center building name when nav links are gone */
  .nav {
    justify-content: center;
  }



  /* History hidden on mobile; class on <li> so it can be re-enabled without HTML changes */
  .nav-item--hide-mobile {
    display: none;
  }

}


/* ================================================================
   Responsive — mobile (<600px)
   ================================================================ */

@media (max-width: 600px) {
  :root {
    --nav-height: 56px;
  }

  .section--hero {
    height: calc(100vh - 56px);
    align-items: flex-start;
    padding-left: 0;
    padding-right: 0;
  }


  /* Gallery stacks to single column on mobile */
  .spaces-gallery {
    grid-template-columns: 1fr;
  }

  /* Transit: stack stations vertically on mobile */
  .transit-list {
    flex-direction: column;
    gap: 0.25rem;
  }

  /* Spaces table: 3-column grid on mobile (floor | type | avail) */
  .spaces-table {
    display: grid;
    grid-template-columns: auto 1fr auto;
  }
  .spaces-table thead,
  .spaces-table tbody,
  .spaces-table tr {
    display: contents;
  }

  /* Tighter inter-column gap on mobile so "Type / Floor Plan" fits on one line */
  .spaces-table th:not(:last-child),
  .spaces-table td:not(:last-child) {
    padding-right: 0.75rem;
  }

  /* Hide desktop-only columns (display:none removes them from grid flow) */
  .spaces-th-sf, .spaces-td-sf,
  .spaces-th-plan, .spaces-td-plan {
    display: none;
  }

  /* Availability column: right-aligned on mobile */
  .spaces-th-avail,
  .spaces-td-avail {
    text-align: right;
  }

  /* Restore combined header text on mobile */
  .spaces-th-floor { font-size: 0; }
  .spaces-th-floor::after { content: 'Floor / SF'; font-size: 1rem; font-weight: 500; }
  .spaces-th-type  { font-size: 0; }
  .spaces-th-type::after  { content: 'Type / Floor Plan'; font-size: 1rem; font-weight: 500; }

  /* Restore SF below floor name */
  .spaces-td-floor::after {
    content: attr(data-sf);
    display: block;
    margin-top: 0.125rem;
  }

  /* Restore View Plan link below type text */
  .spaces-plan-link--mobile {
    display: block;
    margin-top: 0.25rem;
  }

  /* Spaces availability — stack vertically on mobile, both always visible */
  .spaces-avail-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
  }

  .spaces-avail-text {
    font-weight: 500;
    opacity: 1;
  }

  .spaces-avail-inquire {
    position: static;
    opacity: 1;
    font-weight: 300;
  }

  .contact-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1.5rem;
  }

  .contact-row {
    display: contents;
  }

  .contact-row dt,
  .contact-row dd {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-rule);
  }

  .contact-list dt {
    width: auto;
  }

  /* Two-column layout stacks on mobile */
  .section-two-col {
    grid-template-columns: 1fr;
  }

  .section-two-col .section-figure-img {
    height: auto;
    max-height: 60vh;
    object-fit: cover;
  }
}
