/*
  Rinchen Woodworks — Stylesheet
  ---
  • Palette: Black & white only (#111 text; #f6f6f6 section bg)
  • Font: Source Serif 4 (400/500/700)
  • A11y: High contrast, focus styles
  • Performance: Minimal CSS
  • Design: Minimalist, modern, editorial
*/

:root {
  --text-color: #111;
  --text-muted: #666;
  --bg-color: #fff;
  --section-bg-color: #fafafa;
  --border-color: #e8e8e8;
  --focus-ring-color: #000;
  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Source Serif 4', serif;

  /* Spacing System — Generous for minimal feel */
  --space-xs: 0.75rem;
  --space-sm: 1.5rem;
  --space-md: 3rem;
  --space-lg: 6rem;
  --space-xl: 10rem;
  --space-2xl: 14rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Reset & Typography --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 100px;
  scroll-behavior: smooth;
}

body {
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.home {
  padding-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

h3 {
  font-size: 1.3rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  margin-bottom: 1.5em;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

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

a:hover {
  opacity: 0.6;
}

/* --- Layout & Structure --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.main-content {
  padding-top: 120px;
}

.home .main-content {
  padding-top: 0;
}

.main-content .container {
  padding-bottom: 60px;
}

.section-bg {
  background-color: var(--section-bg-color);
  padding: var(--space-lg) 0;
}

.main-content>section {
  padding: var(--space-lg) 0;
  text-align: center;
}

/* --- Header & Navigation --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  padding: var(--space-sm) 0;
  transition: var(--transition-medium);
}

.header.scrolled,
body:not(.home) .header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: clamp(50px, 8vw, 70px);
  width: auto;
  mix-blend-mode: multiply;
  transition: var(--transition-fast);
}

.home .header:not(.scrolled) .logo-img {
  filter: invert(1);
  mix-blend-mode: screen;
}

.logo:hover .logo-img {
  opacity: 0.8;
}

.nav {
  display: flex;
  align-items: center;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-md);
}

.nav a {
  text-decoration: none;
  font-weight: 400;
  color: var(--text-color);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition-fast);
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-color);
  transition: var(--transition-fast);
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

.nav a:hover {
  opacity: 1;
}

.home .header:not(.scrolled) .nav a {
  color: #fff;
}

.home .header:not(.scrolled) .nav a::after {
  background: #fff;
}

/* Mobile Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-color);
  margin: 6px 0;
  transition: var(--transition-fast);
}

.home .header:not(.scrolled) .menu-toggle span {
  background: #fff;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    flex-direction: column;
    justify-content: center;
    transition: var(--transition-slow);
  }

  .nav.active {
    right: 0;
  }

  .nav ul {
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
  }

  .nav a {
    font-size: 1.2rem;
  }
}

/* --- Footer --- */
.footer {
  background-color: var(--bg-color);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border-color);
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.footer p {
  margin: 0.5em 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer a:hover {
  color: var(--text-color);
  opacity: 1;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  text-align: center;
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  overflow: hidden;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-image: url('../img/hero.png');
  background-size: cover;
  background-position: center;
}

.hero-carousel img {
  display: none;
}

.hero-carousel img:nth-child(1) {
  animation-delay: 0s;
}

.hero-carousel img:nth-child(2) {
  animation-delay: 4s;
}

.hero-carousel img:nth-child(3) {
  animation-delay: 8s;
}

.hero-carousel img:nth-child(4) {
  animation-delay: 12s;
}

.hero-carousel img:nth-child(5) {
  animation-delay: 16s;
}

.hero-carousel img:nth-child(6) {
  animation-delay: 20s;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
  z-index: -1;
}

@keyframes crossfade {

  0%,
  100% {
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  33% {
    opacity: 1;
  }

  53% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion) {
  .hero-carousel img {
    animation: none;
  }

  .hero-carousel img:first-child {
    opacity: 1;
  }
}

.hero .subhead {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: var(--space-sm);
  opacity: 1;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: fadeInDown 1.5s ease-out forwards;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  animation: fadeInUp 1.5s ease-out 0.5s forwards;
  opacity: 0;
}

.reveal-text {
  overflow: hidden;
  white-space: nowrap;
  animation: reveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes reveal {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


.cta-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 1.2rem 3rem;
  background-color: transparent;
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  transition: all var(--transition-medium);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background-color: #fff;
  color: #000;
  border-color: #fff;
  opacity: 1;
  letter-spacing: 0.25em;
}

.btn-outline {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background-color: #fff;
  color: #000;
}

/* Dark button variant for light backgrounds */
.btn-dark {
  color: var(--text-color);
  border-color: var(--text-color);
}

.btn-dark:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* --- Services Section --- */
#services {
  text-align: center;
  padding: var(--space-xl) 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.service-card {
  background: transparent;
  padding: var(--space-md);
  text-align: center;
  transition: var(--transition-medium);
}

.service-card svg {
  margin-bottom: var(--space-sm);
  color: var(--text-color);
  transition: var(--transition-medium);
  stroke-width: 1;
}

.service-card:hover svg {
  transform: translateY(-4px);
}

.service-card p {
  margin-bottom: 0;
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-color);
}

@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

@media (max-width: 576px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Featured Work Section --- */
#featured-work {
  text-align: center;
  padding: var(--space-xl) 0;
  background: var(--bg-color);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: var(--space-lg);
}

.featured-grid a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: var(--transition-medium);
}

.featured-grid a:hover {
  opacity: 1;
}

.featured-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.featured-grid a:hover img {
  transform: scale(1.05);
}

.view-more-container {
  margin-top: var(--space-lg);
}

.view-more-container .btn {
  color: var(--text-color);
  border-color: var(--text-color);
}

.view-more-container .btn:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* --- Gallery (Work Page) --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  transition: var(--transition-medium);
}

.gallery-item img:hover {
  opacity: 0.85;
}

@media (max-width: 992px) {

  .gallery,
  .featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {

  .gallery,
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Pager --- */
.pager {
  text-align: center;
  margin-top: var(--space-lg);
}

.pager a {
  margin: 0 0.25rem;
  text-decoration: none;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.pager a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pager a.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-medium);
  z-index: 2000;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  max-width: 90%;
  max-height: 85vh;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition-fast);
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1.5rem;
  opacity: 0.7;
  transition: var(--transition-fast);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  text-align: left;
}

.contact-label {
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.contact-detail {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.contact-detail a {
  text-decoration: none;
  color: var(--text-color);
}

.contact-detail a:hover {
  opacity: 0.6;
}

.map-container {
  position: relative;
  width: 100%;
  padding-bottom: 75%;
  height: 0;
  overflow: hidden;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(100%);
  transition: var(--transition-medium);
}

.map-container:hover iframe {
  filter: grayscale(0%);
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* --- About Page --- */
.about-hero {
  text-align: center;
  padding: var(--space-md) 0 var(--space-lg);
}

.about-hero h1 {
  margin-bottom: var(--space-sm);
}

.about-hero .intro {
  font-size: 1.25rem;
  max-width: 65ch;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.8;
}

.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
  margin: var(--space-xl) 0;
}



/* Homepage specific adjustments */
.home .about-split {
  grid-template-columns: 1.2fr 0.8fr;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.home .about-image-col img {
  max-height: 400px;
  width: auto;
  margin: 0 auto;
  display: block;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: grayscale(100%);
  transition: filter var(--transition-medium);
}

img:hover {
  filter: grayscale(0%);
}

/* Exclude logo and icons from grayscale */
.logo-img,
.service-card svg,
.menu-toggle span,
.footer-logo {
  filter: none;
}


.about-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.gallery-main img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 2px;
}

.gallery-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
}

.gallery-sub img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
}

.about-text-col {
  text-align: left;
}

.about-text-col h2 {
  text-align: left;
  margin-bottom: var(--space-xs);
}

.founder-headline {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--text-muted);
}

.trust-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  margin: var(--space-xl) 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.trust-bar .dot {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

.story-section {
  max-width: 700px;
  margin: 0 auto var(--space-xl);
}

.story-section h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  text-align: center;
}

.story-content {
  padding: var(--space-md) 0;
  text-align: left;
  line-height: 1.9;
}

.about-cta {
  text-align: center;
  padding: var(--space-lg) 0;
}

.about-cta .btn {
  color: var(--text-color);
  border-color: var(--text-color);
}

.about-cta .btn:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

@media (max-width: 768px) {
  .about-split {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .about-hero .intro {
    font-size: 1rem;
  }

  .trust-bar {
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
  }
}

/* --- Form Styles --- */
.contact-form {
  max-width: 500px;
  margin: var(--space-lg) auto 0;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 400;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 0;
  font-family: var(--font-primary);
  font-size: 1rem;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--text-color);
}

/* --- Accordion (generic) --- */
.accordion details {
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-sm) 0;
}

.accordion summary {
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-sm) 0;
}

/* --- Accessibility --- */
a:focus,
button:focus,
input:focus,
textarea:focus,
summary:focus {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* --- Intro text (shared) --- */
.intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Responsive Typography --- */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .header .container {
    padding: 0 var(--space-sm);
  }

  .nav ul {
    gap: var(--space-md);
  }

  .main-content>section {
    padding: var(--space-lg) 0;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --- Buttons & Links --- */
.btn-link {
  display: inline-block;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  border-bottom: 1px solid var(--text-color);
  padding-bottom: 2px;
  transition: var(--transition-fast);
  margin-top: var(--space-sm);
}

.btn-link:hover {
  opacity: 0.6;
  border-bottom-color: transparent;
}