@import url("https://fonts.googleapis.com/css?family=Lora:400,400i,700");

:root {
  --primary: #0b74da;
  --accent: #ffffff;
  --muted: #6b7280;
  --header-height: 60px;
  --footer-height: 60px;
  --bg: #f7fafc;
  --toolbar-bg: linear-gradient(180deg, rgba(248,248,249,0.98), rgba(233,235,239,0.94));
  --toolbar-text: #1f2937;
  --toolbar-border: rgba(17,24,39,0.08);
  --gallery-opacity: 0.8;
}
/* stacking/z-index system */
:root {
  --z-backdrop: 0;     /* fixed background layer */
  --z-hero-bg: 5;      /* hero background pseudo-elements */
  --z-page: 10;        /* page content */
  --z-footer: 50;      /* footer toolbar */
  --z-header: 60;      /* header bar */
  --z-panel: 120;      /* modal panel */
}

/* Theme helpers: `.theme-dark` on `html` switches into dark mode */
.theme-light { --bg: #f7fafc; --primary: #0b74da; --accent: #ffffff; --text: #111; --toolbar-bg: linear-gradient(180deg, rgba(248,248,249,0.98), rgba(233,235,239,0.94)); --toolbar-text: #1f2937; --toolbar-border: rgba(17,24,39,0.08); }
.theme-dark  { --bg: #0b0b0f; --primary: #7aa7ff; --accent: #111827; --text: #e6eef9; --toolbar-bg: rgba(34,37,42,0.96); --toolbar-text: #eef2f8; --toolbar-border: rgba(255,255,255,0.08); }

* { box-sizing: border-box; }
html {
  background: var(--bg);
  transition: background 1s ease, color 1s ease;
}
html, body { height: 100%; }
body {
  position: relative;
  margin: 0;
  font-family: sans-serif;
  color: var(--text, #111);
  background-color: #f7fafc;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  opacity: 0;
  animation: pageFadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageFadeIn {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 0.2;
  }
  60% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
  }
}
/* ensure main leaves room for fixed header and footer */
main {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
  opacity: 1;
  transition: opacity 1.2s ease;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  opacity: 1;
  transition: opacity 1.2s ease;
}
.hero {
  height: calc(100vh - var(--header-height) - var(--footer-height));
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 0;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 1s ease;
  z-index: var(--z-hero-bg);
}

.page { position: relative; z-index: var(--z-page); min-width: 400px; }

header.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  background: var(--toolbar-bg);
  backdrop-filter: blur(8px);
  z-index: var(--z-header);
  border-bottom: 1px solid var(--toolbar-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background 1s ease, border-color 1s ease, box-shadow 1s ease;
}
.hero-page main { height: calc(100vh - var(--header-height) - var(--footer-height)); }
.brand { font-weight: 700; color: var(--toolbar-text); font-size: 1.05rem; min-width: 140px; }
.nav-links {
  display: flex;
  gap: 18px;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
}
.nav-links a {
  color: var(--toolbar-text);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}
.top-times {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 12px;
  color: var(--toolbar-text);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.95;
}
.top-times span {
  white-space: nowrap;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hero-inner { 
  position: relative; 
  z-index: calc(var(--z-page) + 1); 
  color: white; 
  text-align: center; 
  max-width: 920px; 
  padding: 16px; 
  transition: none; 
}

.theme-dark .hero-inner { color: var(--hero-text, #e6eef9); }

/* Ensure hero content remains visible during theme transitions */
.hero-inner, .hero-inner * {
  transition: none !important;
  opacity: 1 !important;
  color: inherit !important;
  mix-blend-mode: normal !important;
}

.nav-links a:hover { background: rgba(255,255,255,0.06); }
.hero h1 { font-size: 2.4rem; margin: 0 0 10px; line-height: 1.05; }
.hero p { font-size: 1.02rem; margin: 0 0 16px; opacity: 0.95; }

.content { padding: 48px 20px; max-width: 1100px; margin: 0 auto; }
.content h2 { margin-top: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.card { background: white; border-radius: 10px; padding: 20px; box-shadow: 0 6px 18px rgba(20,20,40,0.06); }
/* Theme-aware cards */
.theme-dark .card {
  background: linear-gradient(180deg, rgba(50,50,50,0.8) 0%, rgba(20,20,20,0.8) 100%);
  color: var(--text, #e6eef9);
}

.theme-light .card { 
  background:  linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0.8) 100%);
  color: var(--text, #111); 
}

/* When a card is inside a themed panel, let the panel background be primary */
.theme-dark .panel-inner .card { background: transparent; box-shadow: none; }
.theme-light .panel-inner .card { background: rgba(255,255,255,0.98); }

.footer-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 24px;
  background: var(--toolbar-bg);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--toolbar-border);
  z-index: var(--z-footer);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background 1s ease, border-color 1s ease, box-shadow 1s ease;
}
.footer-toolbar a { color: var(--toolbar-text); text-decoration: none; font-weight: 600; }
.tool-btn { min-width:100px; display: inline-block; padding: 8px 12px; border-radius: 999px; background: transparent; color: var(--toolbar-text); text-decoration: none; font-weight: 700; border: 0; height: 36px; display: inline-flex; align-items: center; justify-content: center; transition: background 1s ease, color 1s ease; }
.tool-btn:hover { background: rgba(255,255,255,0.06); }

.theme-light .tool-btn { background: rgba(0,0,0,0.1); color: var(--toolbar-text); }
.theme-dark .tool-btn { background: rgba(255,255,255,0.1); color: var(--toolbar-text); }

/* Header logo */
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 35px; height: auto; display: block; }

/* Theme mode selector */
.theme-mode-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(17,24,39,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}
.theme-mode-btn {
  border: 0;
  background: transparent;
  color: var(--toolbar-text);
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 1s ease, color 1s ease, transform 0.15s ease;
}
.theme-mode-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}
.theme-mode-btn:hover {
  background: rgba(255,255,255,0.08);
}
.theme-mode-btn.is-active {
  color: var(--primary);
  background: rgba(11,116,218,0.08);
  border: 2px solid var(--primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 12px rgba(11,116,218,0.08);
}
.theme-dark .theme-mode-group {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}
.theme-dark .theme-mode-btn.is-active {
  color: var(--primary);
  background: rgba(122,167,255,0.12);
  border-color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 12px rgba(122,167,255,0.08);
}

/* Panel modal */
.panel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); z-index: var(--z-panel); }
.panel.hidden { display: none; }
.panel-inner { width: min(980px, 94%); max-height: 90vh; background: white; border-radius: 12px; overflow: auto; padding: 20px 22px; box-shadow: 0 12px 40px rgba(10,10,30,0.3); position: relative; }
.panel-close { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 26px; line-height:1; cursor: pointer; color: #333; }
.panel-body { padding-top: 28px; }

/* Ensure modal panels follow site theme */
.theme-dark .panel-inner {
  background: linear-gradient(180deg, #3b4044 0%, #2f3336 100%); /* softer grey */
  color: var(--text, #e6eef9);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.04);
}
.theme-dark .panel { background: rgba(0,0,0,0.6); }
.theme-dark .panel-close { color: var(--text, #e6eef9); }
.theme-light .panel-inner { background: #fffdf6; color: var(--text, #111); box-shadow: 0 8px 28px rgba(10,10,30,0.08); border: 1px solid rgba(17,24,39,0.04); }

/* Gentle overlay differences per theme */
.theme-light .panel { background: rgba(0,0,0,0.12); }
.theme-dark .panel { background: rgba(0,0,0,0.65); }

/* Stronger overrides for injected content inside panels */
.theme-dark .panel-inner, .theme-dark .panel-inner * { color: var(--text, #e6eef9) !important; background: transparent !important; }
.theme-light .panel-inner, .theme-light .panel-inner * { color: var(--text, #111) !important; background: transparent !important; }

/* Cards injected into panels should be transparent to let panel background show */
.theme-dark .panel-inner .card { background: transparent !important; box-shadow: none !important; }
.theme-dark .panel-inner .card h3, .theme-dark .panel-inner .card p, .theme-dark .panel-inner .card a { color: var(--text, #e6eef9) !important; }

/* Form controls inside panels: dark theme */
.theme-dark .panel-inner input, .theme-dark .panel-inner textarea, .theme-dark .panel-inner select {
  background: rgba(255,255,255,0.06) !important;
  color: var(--text, #e6eef9) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
}
.theme-light .panel-inner input, .theme-light .panel-inner textarea, .theme-light .panel-inner select {
  background: #fff !important;
  color: var(--text, #111) !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
}

.inner {
  padding: 50px;
}

.glass {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.glass2 {
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.theme-light .glass, .theme-light .glass2 { background-color: rgba(255,255,255,0.2); }
.theme-dark .glass, .theme-dark .glass2 { background-color: rgba(0,0,0,0.2); }

#subfont2 { font-size: 1.4rem; }

.theme-light #mainfont, .theme-light #subfont { text-shadow: 1px 1px 2px white; -webkit-font-smoothing: antialiased; }
.theme-dark #mainfont, .theme-dark #subfont { text-shadow: 2px 2px 4px black; -webkit-font-smoothing: antialiased; }

.theme-light #subfont2 { color: white; }
.theme-dark #subfont2 { color: black; }

.theme-light .linkEmail { color: blue; }
.theme-dark .linkEmail { color: lightcoral; }

.theme-light .gallery-card, .theme-light .gallery-card-top, .theme-light .gallery-card-company { box-shadow: 0 0 0 3px rgba(80, 150, 255, 0.9); }
.theme-dark .gallery-card, .theme-dark .gallery-card-top, .theme-dark .gallery-card-company { box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.9); }


.theme-light .gallery-card-label { background-color: yellow !important; }
.theme-dark .gallery-card-label { background-color: lime !important; }

/* Inline close button visible on full pages */
.panel-close-inline { display: inline-block; float: none; margin-top: -6px; background: transparent; border: 1px solid rgba(0,0,0,0.06); padding: 6px 10px; border-radius: 8px; color: #333; text-decoration: none; font-weight: 700; }
.panel-close-inline:hover{ background: rgba(0,0,0,0.03); }

.theme-light .btn-link {
  background-color: rgba(20, 255, 20, 0.3);
  border: 1px solid rgb(2, 2, 2, 0.7); 
  color: #000000;
}

.theme-dark .btn-link {
  background-color: rgba(120, 0, 255, 0.5);
  border: 1px solid rgb(250, 250, 250, 0.7); 
  color: #ffffff;
}

.btn-link {
  display: inline-block;
  text-decoration: none;
  padding: 6px 16px;
  margin-top:16px;
  border-radius: 7px;
  text-align: center;
}

.spaceHeader { 
  margin-top: 40px;
  padding-bottom: 3px;
  width: 100%; 
  text-align: center;
  font-size: 42px;
  font-weight: bold;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border-radius: 12px;
}

.theme-light .spaceHeader {  
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0.8) 100%);
}

.theme-dark .spaceHeader {  
  background: linear-gradient(180deg, rgba(50,50,50,0.8) 0%, rgba(20,20,20,0.8) 100%);
}

.theme-light #submitButton { background-color: lime; }
.theme-dark #submitButton { background-color: green; }

.hero-bottom-banner {
    position: absolute;
    bottom: 0%;
    left: 0;
    width: 100%;
    height: 17%;
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the entire group of images */
    z-index: 15;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    gap: 30px; 
    padding: 0 15px;
    width: max-content;
    /* We use will-change to make the animation buttery smooth */
    will-change: transform; 
}

.gallery-card {
    height: 50% !important; 
    width: auto !important; 
    aspect-ratio: 16/9 !important; /* Adjust this (e.g., 1/1 for square, 16/9 for wide) */
    object-fit: fill !important; 
    flex-shrink: 0 !important; 
    border-radius: 20px !important;
    background-color: white !important;
    padding: 4px !important;
    margin: 0 10px;
    opacity: var(--gallery-opacity);
}

.gallery-card-top {
    height: 60% !important; 
    width: auto !important; 
    aspect-ratio: 4/3 !important; /* Adjust this (e.g., 1/1 for square, 16/9 for wide) */
    object-fit: fill !important; 
    flex-shrink: 0 !important; 
    border-radius: 20px !important;
    background-color: white !important;
    padding: 7px !important;
    margin: 0 10px;
    opacity: var(--gallery-opacity);
}

.gallery-card-company {
    height: 55% !important; 
    width: auto !important; 
    aspect-ratio: 5/3 !important; /* Adjust this (e.g., 1/1 for square, 16/9 for wide) */
    object-fit: fill !important; 
    flex-shrink: 0 !important; 
    border-radius: 8px !important;
    background-color: white !important;
    padding: 7px !important;
    margin: 0 10px;
    opacity: var(--gallery-opacity);
}

.gallery-card-label {
    height: 25% !important; 
    width: auto !important; 
    aspect-ratio: 4/1 !important; /* Adjust this (e.g., 1/1 for square, 16/9 for wide) */
    object-fit: fill !important; 
    flex-shrink: 0 !important; 
    border-radius: 8px !important;
    padding: 7px !important;
    margin: 0 10px;
    opacity: var(--gallery-opacity);
}

@media screen and (orientation: portrait) and (min-width: 0px) and (max-width: 700px) {
  .panel-inner{ width: 96%; padding: 16px; }
  .panel-close-inline{ float:none; display:block; margin: 0 0 12px; }
  .footer-toolbar { left: 0px; right: 0px; }
  .top-times { display: none; }
  #mainfont { font-size: 1.6rem !important; }
  #subfont { font-size: 1.0rem !important; }
  #subfont2 { font-size: 0.8rem !important; }
  .page { min-width: auto; }
  .btn-link { margin-top: 0px; }
}

