/* Fjord Studio: shared styles for every page. */
  /* Theme follows the system by default; the button in the nav pins light or dark.
     Light is a fjord at midday, dark is the same fjord under the northern lights. */
  :root { color-scheme: light dark; }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
  :root {
    --teal: light-dark(#0e9c8c, #2dd4bf);
    --green: light-dark(#2f9e5a, #4ade80);
    --purple: light-dark(#7c5cf0, #a78bfa);
    --bg: light-dark(#f3f7fb, #0c1930);
    --bg-top: light-dark(#e6f0f8, #08101e);
    --fg: light-dark(#0e1b2e, #eef3fb);
    --muted: light-dark(#4f627c, #93a5c4);
    --card: light-dark(rgba(255, 255, 255, .72), rgba(255, 255, 255, .045));
    --card-solid: light-dark(#ffffff, #14243d);
    --border: light-dark(rgba(14, 27, 46, .1), rgba(255, 255, 255, .1));
    --glow: light-dark(rgba(14, 156, 140, .18), rgba(45, 212, 191, .22));
  }
  * { box-sizing: border-box; margin: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg); color: var(--fg); line-height: 1.65; overflow-x: hidden;
  }
  body, nav, .app-card, .ph, .contact, .modebtn, footer { transition: background-color .5s ease, color .5s ease, border-color .5s ease; }
  h1, h2, h3 { font-family: "Quicksand", sans-serif; letter-spacing: -.01em; }
  a { color: var(--teal); }
  .wrap { max-width: 1360px; margin: 0 auto; padding: 0 clamp(20px, 3vw, 40px); position: relative; }

  nav {
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg-top) 70%, transparent);
    border-bottom: 1px solid var(--border);
  }
  .navin { padding: 12px clamp(16px, 2vw, 28px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .navbrand { display: flex; align-items: center; gap: 11px; font-family: "Quicksand", sans-serif;
              font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
  .navbrand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 12px var(--glow); }
  .navright { display: flex; align-items: center; gap: 12px; }
  .navlink { text-decoration: none; font-weight: 700; font-size: .92rem; padding: 9px 16px; border-radius: 999px;
             background: linear-gradient(100deg, var(--teal), var(--green)); color: light-dark(#ffffff, #06251f); white-space: nowrap; }

  /* One theme button cycling Light, Dark, System. */
  .modebtn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
             border: 1px solid var(--border); background: var(--card-solid); color: var(--fg); font: inherit; font-size: .82rem;
             font-weight: 700; cursor: pointer; }
  .modebtn:hover { border-color: var(--teal); }
  .modebtn .ico { position: relative; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
                  background: linear-gradient(135deg, var(--teal), var(--purple)); color: #fff; box-shadow: 0 4px 12px var(--glow); }
  .modebtn .ico svg { position: absolute; width: 15px; height: 15px; opacity: 0; transform: rotate(-90deg) scale(.4);
                      transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease; }
  .modebtn[data-mode="light"] .i-light, .modebtn[data-mode="dark"] .i-dark, .modebtn[data-mode="auto"] .i-auto { opacity: 1; transform: rotate(0) scale(1); }
  .modebtn .lbl { min-width: 46px; text-align: left; }
  @media (max-width: 560px) { .modebtn .lbl { display: none; } .modebtn { padding-right: 6px; } }

  /* Hero: the living fjord */
  /* Fills the first screen exactly (viewport minus the sticky nav), on any display. */
  .fjord { position: relative; height: calc(100vh - 62px); height: calc(100svh - 62px); min-height: 560px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
  .scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
  .scene canvas { display: block; width: 100%; height: 100%; }
  .hero-inner { position: relative; z-index: 2; padding: 40px 24px 220px; }
  .eyebrow { display: inline-block; font-size: 1rem; font-weight: 700; color: var(--teal); margin-bottom: 16px; }
  .fjord h1 { font-size: clamp(2.8rem, 8vw, 4.6rem); font-weight: 700; line-height: 1.08; }
  .fjord h1 .grad { background: linear-gradient(100deg, var(--teal), var(--green), var(--purple));
                    background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
                    color: transparent; animation: shimmer 7s linear infinite; }
  @keyframes shimmer { to { background-position: 200% center; } }
  .fjord p { max-width: 680px; margin: 22px auto 0; color: var(--muted); font-size: 1.25rem; }
  .scrollcue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--muted); z-index: 2;
               animation: bob 2.4s ease-in-out infinite; }
  @keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

  section { padding: 84px 0 0; }
  h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 26px; }
  .apps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .app-card {
    display: block; position: relative; text-decoration: none; color: inherit;
    background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 30px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, background-color .5s ease;
  }
  a.app-card { cursor: pointer; }
  a.app-card:hover { transform: translateY(-6px); border-color: var(--teal); box-shadow: 0 22px 60px var(--glow); }
  .app-head { display: flex; align-items: center; gap: 15px; margin-bottom: 14px; }
  .app-icon { width: 60px; height: 60px; border-radius: 16px; box-shadow: 0 8px 26px rgba(124, 58, 237, .3); }
  .app-icon.baseball { background: linear-gradient(135deg, #0ea5e9, #166534); display: flex; align-items: center; justify-content: center;
                       box-shadow: 0 8px 26px rgba(14, 165, 233, .3); }
  .app-card h3 { font-size: 1.3rem; }
  .app-card .sub { color: var(--teal); font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .app-card p { color: var(--muted); font-size: .98rem; }
  .app-card .go { position: absolute; top: 28px; right: 26px; color: var(--teal); transition: transform .3s ease; }
  a.app-card:hover .go { transform: translateX(5px); }
  .badge { display: inline-block; margin-left: 10px; padding: 3px 12px; border-radius: 999px; font-size: .7rem; font-weight: 700;
           letter-spacing: .05em; text-transform: uppercase; background: color-mix(in srgb, var(--purple) 16%, transparent);
           color: var(--purple); border: 1px solid color-mix(in srgb, var(--purple) 35%, transparent); vertical-align: middle; }

  .philosophy { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .ph { border: 1px solid var(--border); border-radius: 20px; padding: 26px; background: var(--card);
        backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .ph .ic { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
            background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 18%, transparent), color-mix(in srgb, var(--purple) 18%, transparent));
            border: 1px solid var(--border); }
  .ph .ic svg { stroke: var(--teal); }
  .ph h3 { font-size: 1.05rem; margin-bottom: 6px; }
  .ph p { color: var(--muted); font-size: .95rem; }

  .contact { margin-top: 88px; text-align: center; border-radius: 26px; padding: 52px 26px; position: relative; overflow: hidden;
             border: 1px solid var(--border); background: var(--card); }
  .contact .scene { opacity: .9; }
  .contact > :not(.scene) { position: relative; z-index: 1; }
  .contact h2 { margin-bottom: 8px; }
  .contact p { color: var(--muted); }
  .btn { display: inline-block; margin-top: 20px; padding: 14px 32px; border-radius: 999px;
         background: linear-gradient(100deg, var(--teal), var(--green)); color: light-dark(#ffffff, #06251f); text-decoration: none; font-weight: 700;
         font-family: "Quicksand", sans-serif; font-size: 1.02rem; box-shadow: 0 12px 34px var(--glow);
         transition: transform .2s ease, box-shadow .2s ease; }
  .btn:hover { transform: translateY(-2px); }
  /* The same look whether it is a link or a <button>: no browser border or bevel. */
  button.btn { border: 0; appearance: none; -webkit-appearance: none; cursor: pointer; line-height: 1.65; }
  .btn:disabled { opacity: .6; transform: none; cursor: wait; }
  .contact .alt { margin-top: 14px; font-size: .9rem; }
  .contact .alt a { color: var(--teal); }

  /* Contact page: a short fjord band with the title, then the form card. */
  .pagehead { position: relative; min-height: 340px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
  .pagehead .hero-inner { padding: 60px 24px 70px; }
  .pagehead h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; line-height: 1.1; }
  .pagehead p { max-width: 600px; margin: 14px auto 0; color: var(--muted); font-size: 1.12rem; }
  .contact.page { margin-top: -40px; text-align: left; }
  .contact.page .cform { margin-top: 6px; }
  .contact.page .cstatus { text-align: left; }
  .crumb { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .9rem; margin-bottom: 18px; }
  .crumb:hover { color: var(--teal); }

  /* Contact form */
  .cform { max-width: 640px; margin: 26px auto 0; text-align: left; display: grid; gap: 14px; }
  .cform .row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
  @media (max-width: 560px) { .cform .row { grid-template-columns: 1fr; } }
  .cform label { display: grid; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--muted); }
  .cform input, .cform textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--fg); padding: 13px 16px; border-radius: 14px;
    border: 1px solid var(--border); background: var(--card-solid); transition: border-color .2s ease, box-shadow .2s ease;
  }
  .cform input:focus, .cform textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--glow); }
  .cform textarea { min-height: 150px; resize: vertical; }
  .cform .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
  .cform .actions .btn { margin-top: 0; }
  .cform .alt { font-size: .9rem; color: var(--muted); }
  .cform .alt a { color: var(--teal); }
  .cform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  .cstatus { margin-top: 16px; min-height: 1.4em; font-weight: 700; font-size: .98rem; }
  .cstatus.ok { color: var(--green); }
  .cstatus.err { color: light-dark(#c0392b, #ff8a80); }
  .csent { max-width: 560px; margin: 26px auto 0; padding: 26px; border-radius: 20px; border: 1px solid var(--border); background: var(--card-solid); }
  .csent .tick { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
                 background: linear-gradient(135deg, var(--teal), var(--green)); color: #fff; box-shadow: 0 10px 26px var(--glow); }
  .csent h3 { font-size: 1.2rem; margin-bottom: 6px; }

  footer { margin-top: 84px; border-top: 1px solid var(--border); padding: 28px 0 48px; color: var(--muted); font-size: .9rem;
           display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
  footer a { color: var(--muted); }

  .totop { position: fixed; right: 22px; bottom: 22px; z-index: 20; width: 48px; height: 48px; border-radius: 50%; border: none;
           background: linear-gradient(135deg, var(--teal), var(--purple)); color: #fff; cursor: pointer; display: grid; place-items: center;
           box-shadow: 0 10px 26px var(--glow); opacity: 0; transform: translateY(16px) scale(.8); pointer-events: none;
           transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1); }
  .totop.show { opacity: 1; transform: none; pointer-events: auto; }

  .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.in { opacity: 1; transform: none; }
  :focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
  }
