/* OrangeBlue Studio — minimal static site for S3 */

:root {
  --bg: #ffffff;
  --text: #111111;
  --text-muted: #5c5c5c;
  --nav: #8e8e8e;
  --nav-active: #1d1d1f;
  --body-text: #424245;
  --logo-secondary: #515154;
  --gutter: clamp(2rem, 6vw, 3.75rem);
  --max-content: 1120px;
}

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
h1,
h2,
h3,
p,
figure,
blockquote,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-feature-settings: "kern" 1;
}

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

a:hover {
  opacity: 0.65;
}

/* Intro splash (index only) */
.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition:
    opacity 0.55s ease,
    visibility 0.55s ease;
}

.splash__skip {
  position: absolute;
  top: var(--gutter);
  right: var(--gutter);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nav);
  text-decoration: underline;
  text-underline-offset: 3px;
  z-index: 1;
}

.splash__skip:hover {
  opacity: 0.65;
}

.splash__inner {
  text-align: center;
  padding: 2rem;
}

.splash__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.splash__word {
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(2.75rem, 10vw, 5rem);
  font-weight: 700;
  font-style: normal;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: 0.04em;
}

.splash__char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(-5deg);
  animation: splash-char-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 0.065s);
}

@keyframes splash-char-in {
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

.splash__sub {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--logo-secondary);
  opacity: 0;
  transform: translateY(0.35rem);
  animation: splash-sub-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

@keyframes splash-sub-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.splash-done .splash {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

  .splash__sub {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: var(--gutter);
  padding-bottom: 2.25rem;
}

.logo {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.logo-bold {
  font-weight: 700;
  color: var(--text);
}

.logo-light {
  font-weight: 400;
  color: var(--logo-secondary);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2rem;
  justify-content: flex-end;
  list-style: none;
}

.nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nav);
}

.nav a.is-active {
  color: var(--nav-active);
  font-weight: 600;
  letter-spacing: 0.18em;
}

main {
  flex: 1;
  padding: 0 var(--gutter) 4rem;
}

.site-footer {
  margin-top: auto;
  padding: 2rem var(--gutter) var(--gutter);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--nav);
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Home — project grid (after splash) */
.home-projects {
  padding-top: 0.5rem;
}

@keyframes home-project-card-in {
  from {
    opacity: 0;
    transform: translateY(0.85rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body:not(.splash-done) .page-home .project-card {
  animation: none;
  opacity: 0;
  transform: translateY(0.85rem);
}

body.splash-done .page-home .project-card {
  animation: home-project-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--pi) * 0.09s);
}

@media (prefers-reduced-motion: reduce) {
  body:not(.splash-done) .page-home .project-card,
  body.splash-done .page-home .project-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Error document */
.error-hero {
  min-height: calc(100vh - 12rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 0;
}

.error-hero .error-code {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nav);
}

.error-hero h1 {
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.error-hero .error-message {
  margin: 1.5rem auto 0;
  max-width: 28rem;
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.65;
  color: var(--body-text);
}

.error-hero .error-back {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nav-active);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* About */
.about-grid {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 4.5vw, 3.5rem);
  align-items: start;
}

.about-photo {
  margin: 0;
  width: min(100%, 430px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #eee;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  display: block;
  filter: grayscale(100%);
}

.about-text {
  color: var(--body-text);
  font-size: 1.0625rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.about-text p {
  margin: 0 0 1.25rem;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

/* Contact */
.contact-grid {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact-block {
  font-size: 1.0625rem;
  color: var(--body-text);
  line-height: 1.85;
  letter-spacing: 0.01em;
}

.contact-block p {
  margin: 0 0 0.35rem;
}

.contact-block a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.philosophy p {
  margin: 0 0 0.85rem;
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 300;
  color: var(--body-text);
  line-height: 1.65;
  letter-spacing: 0.015em;
}

.philosophy p:last-child {
  margin-bottom: 0;
}

/* Projects */
.projects-intro {
  max-width: var(--max-content);
  margin: 0 auto 2.5rem;
}

.project-grid {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.project-card {
  margin: 0;
}

.project-card a {
  display: block;
}

.project-card a:hover {
  opacity: 1;
}

.project-card a:hover .project-thumb img {
  opacity: 0.92;
}

.project-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: #eaeaea;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease;
}

.project-title {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--nav);
}

/* Project detail pages */
.project-detail {
  max-width: var(--max-content);
  margin: 0 auto;
}

.project-detail__hero {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  aspect-ratio: 16 / 10;
  max-height: 520px;
  overflow: hidden;
  background: #eaeaea;
}

.project-detail__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-detail__body {
  max-width: 38rem;
  color: var(--body-text);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.project-detail__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.project-detail__meta {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nav);
}

.project-detail__body p {
  margin: 0 0 1.25rem;
}

.project-detail__back {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nav-active);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Project gallery — centered two columns, generous side margins (portfolio feel) */
.page-project--gallery main {
  padding: 0 clamp(1.75rem, 8vw, 6rem) 3.5rem;
}

.project-gallery {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: clamp(2rem, 4.5vw, 3.75rem);
  align-items: start;
}

.project-gallery__media,
.project-gallery__aside {
  min-width: 0;
}

.project-gallery__media {
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2vw, 1.35rem);
}

.project-gallery__figure {
  margin: 0;
  padding: 0;
  width: 100%;
  background: #fff;
  border: none;
  overflow: hidden;
  line-height: 0;
}

.project-gallery__figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
  outline: none;
  vertical-align: bottom;
}

.project-gallery__aside {
  position: static;
  align-self: start;
  box-sizing: border-box;
  width: 100%;
  max-width: min(100%, 26rem);
  text-align: left;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.project-gallery__back {
  max-width: 1060px;
  margin: 2.5rem auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.project-gallery__back a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nav);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-gallery__back a:hover {
  color: var(--nav-active);
  opacity: 1;
}

.project-gallery__title {
  margin: 0 0 0.4rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
}

.project-gallery__subtitle {
  margin: 0 0 1.35rem;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: break-word;
}

.project-gallery__meta {
  margin: 0 0 1.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: var(--body-text);
  overflow-wrap: break-word;
}

.project-gallery__body {
  color: var(--body-text);
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: 0.012em;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.project-gallery__body p {
  margin: 0 0 1.35rem;
}

.project-gallery__body p:last-child {
  margin-bottom: 0;
}

/* Narrow viewport: stack to one column — aside stays static (no sticky) */
@media (max-width: 900px) {
  .page-project--gallery main {
    padding-left: max(
      clamp(1rem, 4vw, 1.75rem),
      env(safe-area-inset-left, 0px)
    );
    padding-right: max(
      clamp(1rem, 4vw, 1.75rem),
      env(safe-area-inset-right, 0px)
    );
    padding-bottom: max(2.25rem, env(safe-area-inset-bottom, 0px));
  }

  .project-gallery {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    max-width: none;
  }

  .project-gallery__aside {
    position: static;
    max-width: none;
    order: 1;
    padding-bottom: 0;
  }

  .project-gallery__media {
    order: 2;
    gap: 0.75rem;
  }

  .project-gallery__title {
    font-size: 1.0625rem;
    letter-spacing: 0.1em;
  }

  .project-gallery__subtitle {
    margin-bottom: 1rem;
    font-size: 1rem;
  }

  .project-gallery__meta {
    margin-bottom: 1.2rem;
  }

  .project-gallery__body {
    font-size: 1rem;
    line-height: 1.75;
    max-width: none;
  }

  .project-gallery__body p {
    margin-bottom: 1.15rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-height: none;
    max-width: 380px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

}

