/* ==========================================================================
   Ryan Glass, Inc. — ryanglass.com
   Static one-page site. No frameworks, no external requests.
   Brand palette sampled from the RGI logo.
   ========================================================================== */

:root {
  --navy-950: #0b2239;
  --navy-900: #10304b;
  --navy-800: #14324a;
  --blue-600: #3d6a96;
  --blue-400: #6f94b8;
  --green-600: #2e7d64;
  --green-400: #6aa892;
  --ink: #1d2c3b;
  --muted: #58697a;
  --line: #dde6ec;
  --bg: #ffffff;
  --bg-alt: #f2f6f8;
  --serif: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  --sans: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --shadow-sm: 0 1px 3px rgba(11, 34, 57, .10);
  --shadow-md: 0 6px 24px rgba(11, 34, 57, .12);
  --shadow-lg: 0 18px 48px rgba(11, 34, 57, .22);
  --radius: 10px;
  --header-h: 76px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy-900);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
a { color: var(--blue-600); }

.container {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section-alt { background: var(--bg-alt); }

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-bottom: .9em;
}
.eyebrow-light { color: var(--green-400); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-sub { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: .8rem 1.7rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .97rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(120deg, var(--blue-600), var(--green-600));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }

.btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .55);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}
.brand img {
  width: auto;
  height: clamp(38px, 5vw, 46px);
}
.brand-text {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 2.4vw, 1.28rem);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--navy-800);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}

.site-nav a {
  color: var(--navy-900);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-nav a:hover { color: var(--green-600); border-bottom-color: var(--green-600); }

.nav-phone {
  border: 1.5px solid var(--blue-600);
  border-radius: 6px;
  padding: .5rem 1.1rem !important;
  color: var(--blue-600) !important;
}
.nav-phone:hover {
  background: var(--blue-600);
  color: #fff !important;
  border-bottom-color: transparent !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy-900);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 34, 57, .30), rgba(11, 34, 57, 0) 30%, rgba(11, 34, 57, .55) 100%),
    linear-gradient(105deg, rgba(11, 34, 57, .92) 0%, rgba(16, 48, 75, .72) 45%, rgba(16, 48, 75, .25) 78%, rgba(16, 48, 75, .15) 100%);
}

.hero-content { padding: 7rem 0 8rem; }
.hero-content h1 { color: #fff; text-wrap: balance; max-width: 15.5em; }

.hero-sub {
  color: rgba(255, 255, 255, .88);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 36rem;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero-credit {
  position: absolute;
  right: 1.25rem;
  bottom: .9rem;
  margin: 0;
  font-size: .74rem;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .55);
}

/* ---------- Pillars ---------- */

.pillars { position: relative; z-index: 2; }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: -3.4rem;
}

.pillar {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green-600);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.6rem 1.25rem;
}
.pillar:nth-child(2) { border-top-color: var(--blue-600); }
.pillar:nth-child(3) { border-top-color: var(--navy-800); }
.pillar h3 { margin-bottom: .35em; }
.pillar p { margin: 0; color: var(--muted); font-size: .97rem; }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.checklist li {
  position: relative;
  padding: .35rem 0 .35rem 2.1rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background:
    linear-gradient(120deg, var(--blue-600), var(--green-600));
}
.checklist li::after {
  content: "";
  position: absolute;
  left: .30rem;
  top: 1rem;
  width: .55rem;
  height: .3rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

/* The mirror card — a quiet nod to the original "reflected glass" logo idea */
.mirror-card {
  background:
    linear-gradient(160deg, #ffffff 0%, #f4f8fa 55%, #e8f0f4 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2.5rem) 2rem;
  overflow: hidden;
}
.mirror-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.6rem, 2vw, 1.1rem);
}
.mirror-lockup img {
  width: auto;
  height: clamp(44px, 11vw, 76px);
}
.mirror-lockup span {
  font-family: var(--serif);
  font-size: clamp(.95rem, 3.6vw, 1.55rem);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--navy-800);
  white-space: nowrap;
}
.mirror-reflected {
  transform: scaleY(-1);
  opacity: .4;
  margin-top: 4px;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .75), transparent 65%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, .75), transparent 65%);
}

/* ---------- Services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.service {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-400);
}

.service svg {
  width: 2.4rem;
  height: 2.4rem;
  stroke: var(--blue-600);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: .9rem;
}
.service:hover svg { stroke: var(--green-600); }

.service h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-900);
  margin: 0;
  line-height: 1.35;
}

/* ---------- Projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 215px;
  gap: 1.1rem;
}

.project-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  outline-offset: 3px;
}
.card-featured { grid-column: span 2; grid-row: span 2; }

/* Fill the last row edge-to-edge on wide screens (7 cards -> 2 wide cards close the grid) */
@media (min-width: 961px) {
  .projects-grid .project-card:nth-last-child(-n+2) { grid-column: span 2; }
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.project-card:hover img { transform: scale(1.045); }

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 34, 57, .82) 0%, rgba(11, 34, 57, .25) 42%, rgba(11, 34, 57, 0) 65%);
  transition: background .2s ease;
}

.project-label {
  position: absolute;
  z-index: 1;
  left: 1.1rem;
  right: 1.1rem;
  bottom: .95rem;
  color: #fff;
}
.project-label strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(11, 34, 57, .6);
}
.card-featured .project-label strong { font-size: 1.35rem; }
.project-label em {
  font-style: normal;
  font-size: .8rem;
  opacity: .82;
}

/* ---------- Contact ---------- */

.section-dark {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(61, 106, 150, .35), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(46, 125, 100, .28), transparent 60%),
    var(--navy-950);
  color: rgba(255, 255, 255, .88);
}
.section-dark h2 { color: #fff; }

.contact-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}

.contact-lines { margin-top: 2rem; font-style: normal; }
.contact-lines p {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .8rem 0;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  font-size: 1.05rem;
}
.contact-lines span {
  flex: 0 0 3.5rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-400);
}
.contact-lines a { color: #fff; text-decoration: none; font-weight: 600; }
.contact-lines a:hover { text-decoration: underline; }

.contact-form {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.field { margin-bottom: 1.1rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: .35rem;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: .7rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: #fbfdfe;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(61, 106, 150, .18);
}
.field textarea { resize: vertical; min-height: 8rem; }

.btn-submit { width: 100%; font-size: 1.05rem; }
.btn-submit:disabled { opacity: .6; cursor: wait; transform: none; }

/* Honeypot: visually removed, still in the DOM for bots to trip on */
.hp-field {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status {
  margin: 1rem 0 0;
  font-size: .95rem;
  font-weight: 600;
  min-height: 1.4em;
  color: var(--muted);
}
.form-status.ok { color: var(--green-600); }
.form-status.err { color: #b3462e; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-950);
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .7);
  padding: 2.5rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 2rem;
  align-items: center;
}

.footer-word {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: #fff;
  margin: 0;
}
.footer-tag { margin: .15rem 0 0; font-size: .85rem; }

.footer-contact { text-align: right; font-size: .95rem; font-style: normal; }
.footer-contact p { margin: 0 0 .2rem; }
.footer-contact a { color: #fff; text-decoration: none; font-weight: 600; }

.footer-copy {
  grid-column: 1 / -1;
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .82rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 1200px);
  max-height: 92vh;
}
.lightbox::backdrop { background: rgba(7, 20, 34, .9); }

.lightbox figure { margin: 0; }
.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 80vh;
  width: auto;
  height: auto;
  margin-inline: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(255, 255, 255, .85);
  font-size: .95rem;
  padding: .8rem .2rem 0;
}

.lb-close, .lb-prev, .lb-next {
  position: fixed;
  z-index: 5;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .25); }

.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal on scroll ---------- */

/* Hidden state only applies when JS is running (html.js is set by main.js),
   so the page stays fully visible without JavaScript. */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* No-JS and reduced motion: show everything */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .project-card img { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-visual { order: -1; }
  .mirror-card { max-width: 420px; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: .5rem 1.25rem 1rem;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .site-nav a:last-of-type { border-bottom: none; }
  .nav-phone { margin-top: .5rem; text-align: center; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero-content { padding: 5rem 0 6.5rem; }
  .hero-credit { display: none; }

  .pillars-grid { grid-template-columns: 1fr; margin-top: -2.6rem; gap: .9rem; }
  .pillar { padding: 1.2rem 1.3rem 1rem; }

  .projects-grid { grid-template-columns: 1fr; grid-auto-rows: 230px; }
  .card-featured { grid-column: auto; grid-row: span 2; }

  .field-row { grid-template-columns: 1fr; gap: 0; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-contact { text-align: left; }

  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
}
