/* ==========================================================================
   Halftank Studio — shared stylesheet
   Used by index.html and case_studies.html. One file, one system.

   COLOR RULES (light ground — the opposite of the deck's rules):
     olive  #4D6B4E  text accent, headings, links      5.6:1  OK for type
     green  #17B24B  FILLS ONLY — bars, rules, buttons 2.6:1  NEVER type on light
     yellow #EDE80F  FILLS ONLY, dark text on top      1.2:1  NEVER type on light
     ink    #2A2826  body                             13.9:1
     muted  #5F5C58  secondary text                    7.2:1

   OOUX colors are SEMANTIC. They appear only where they label an actual
   ORCA element. Never as decoration, never cycled by nth-child.
   ========================================================================== */

:root{
  --olive:#4D6B4E;
  --green:#17B24B;
  --yellow:#EDE80F;
  --ink:#2A2826;
  --muted:#5F5C58;
  --paper:#FAF8F5;
  --card:#FFFFFF;
  --hair:rgba(77,107,78,.22);

  --ooux-object:#2F6FB5;
  --ooux-propernoun:#B8860B;
  --ooux-action:#3E8B1F;
  --ooux-attribute:#C2185B;
}

*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:'Libre Franklin',system-ui,sans-serif;background:var(--paper);color:var(--ink);line-height:1.65}

/* --- GLOBAL IMAGE GUARD -----------------------------------------------
   Without this, any image in a container that has no explicit size renders
   at its natural pixel dimensions. @4x source art then blows the page apart.
   Keep this rule. It is the cheapest bug insurance in the file.            */
img{max-width:100%;height:auto;display:block}

.container{max-width:1100px;margin:0 auto;padding:0 2rem}
a{color:var(--olive)}

/* ==========================================================================
   HEADER — shared by both pages
   ========================================================================== */
header{background:var(--ink);border-bottom:5px solid var(--green);position:sticky;top:0;z-index:100}
header .container{padding-top:1.1rem;padding-bottom:1.1rem}
header.home .container{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}

/* anything inside the dark header is light type */
header h1,header .page-intro,header .wordmark,header p{color:#fff}
header h1{font-size:clamp(1.7rem,3.4vw,2.4rem);font-weight:800;line-height:1.2;letter-spacing:-.01em;margin-bottom:.4rem}
header .page-intro{color:#C9C6C1;font-size:1.05rem;max-width:62ch}

.logo{display:flex;align-items:center;gap:.9rem}
.logo img{width:46px}
.wordmark{font-weight:800;font-size:1.15rem;letter-spacing:-.01em;line-height:1.2}
.wordmark span{font-weight:400}
.wordmark small{display:block;font-size:.72rem;font-weight:400;letter-spacing:.11em;text-transform:uppercase;color:#B9B6B1;margin-top:.15rem}

nav ul{display:flex;list-style:none;gap:1.6rem;flex-wrap:wrap}
nav a{color:#fff;text-decoration:none;font-weight:600;font-size:.95rem;padding:.3rem 0;border-bottom:2px solid transparent}
nav a:hover,nav a:focus{color:var(--green);border-bottom-color:var(--green)}
.menu-toggle{display:none;background:none;border:none;color:#fff;font-size:1.5rem;cursor:pointer}

/* back link sits on the dark header — must be light, not olive */
.back-link{display:inline-block;color:#fff;text-decoration:none;font-weight:600;font-size:.92rem;margin-bottom:1.1rem;border-bottom:2px solid var(--green);padding-bottom:2px}
.back-link:hover{color:var(--green)}

@media(max-width:820px){
  .menu-toggle{display:block}
  header.home nav{display:none;width:100%}
  header.home nav.open{display:block}
  nav ul{flex-direction:column;gap:.9rem;padding-top:1rem}
}

/* ==========================================================================
   TYPE + SECTIONS
   ========================================================================== */
section{padding:4rem 0;border-top:1px solid var(--hair)}
.eyebrow{font-size:.78rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--olive);margin-bottom:.7rem}
h2{font-size:clamp(1.7rem,3vw,2.3rem);font-weight:800;color:var(--ink);line-height:1.2;margin-bottom:1.1rem;letter-spacing:-.01em}
h3{font-size:1.25rem;color:var(--olive);margin-bottom:.6rem;font-weight:700}
h4{font-size:1.1rem;color:var(--olive);margin-bottom:.5rem;font-weight:700}
.lede{font-size:1.13rem;color:var(--muted);max-width:68ch;margin-bottom:2.2rem}
p{margin-bottom:1rem}
p:last-child{margin-bottom:0}
ul,ol{margin:1rem 0 1.5rem 1.6rem;line-height:1.75}

/* ==========================================================================
   BUTTONS — green fill, INK text. White on green is 2.8:1 and fails.
   ========================================================================== */
.btn,.cta-button{display:inline-block;padding:.9rem 1.7rem;font-weight:700;text-decoration:none;border:2px solid transparent;cursor:pointer}
.btn-primary,.cta-button{background:var(--green);color:var(--ink)}
.btn-primary:hover,.cta-button:hover{background:var(--olive);color:#fff}
.btn-secondary{border-color:var(--olive);color:var(--olive);background:transparent}
.btn-secondary:hover{background:var(--olive);color:#fff}
.actions,.contact-row{display:flex;gap:1rem;flex-wrap:wrap;margin-top:2.2rem;align-items:center}

/* ==========================================================================
   HOME PAGE
   ========================================================================== */
.hero{padding:5rem 0 3.5rem;border-top:none}
.hero h1{font-size:clamp(2rem,4.6vw,3.1rem);font-weight:800;line-height:1.14;letter-spacing:-.02em;max-width:17ch;color:var(--ink)}
.hero .sub{font-size:1.25rem;color:var(--muted);margin-top:1.4rem;max-width:58ch}
.hero .rule{width:76px;height:6px;background:var(--green);margin-bottom:1.8rem}

.grid3{display:grid;grid-template-columns:repeat(auto-fit,minmax(265px,1fr));gap:1.6rem}
.card{background:var(--card);border:1px solid var(--hair);border-top:5px solid var(--green);padding:1.8rem}
.card.alt{border-top-color:var(--olive)}
.card p{color:var(--ink);font-size:.98rem}
.card .meta{display:block;margin-top:1rem;padding-top:.9rem;border-top:1px solid var(--hair);font-size:.85rem;color:var(--muted)}

.shapes{list-style:none;max-width:70ch;margin-left:0}
.shapes li{padding:.85rem 0 .85rem 1.6rem;border-bottom:1px solid var(--hair);position:relative;font-size:1.05rem}
.shapes li:last-child{border-bottom:none}
.shapes li::before{content:'';position:absolute;left:0;top:1.35rem;width:9px;height:9px;background:var(--green)}

/* ORCA — the only place OOUX colors live */
.orca{background:#fff;border:1px solid var(--hair);padding:2rem;margin-top:2rem}
.legend{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:1rem;margin-top:1.4rem}
.key{padding:.9rem 1rem;background:var(--paper);border-left:6px solid var(--ink)}
.key b{display:block;font-size:.95rem}
.key span{font-size:.86rem;color:var(--muted)}
.key.object{border-left-color:var(--ooux-object)}
.key.propernoun{border-left-color:var(--ooux-propernoun)}
.key.action{border-left-color:var(--ooux-action)}
.key.attribute{border-left-color:var(--ooux-attribute)}
.legend-note{margin-top:1.3rem;font-size:.9rem;color:var(--muted);font-style:italic}

/* home-page case study cards */
.case{background:var(--card);border:1px solid var(--hair);overflow:hidden;display:flex;flex-direction:column}
/* contain, not cover — these are illustrations, and cover crops the artwork.
   Padding keeps the art off the edges of the olive field. */
.case .thumb{background:var(--olive);height:170px;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:1.1rem}
.case .thumb img{width:100%;height:100%;object-fit:contain}
.case .body{padding:1.5rem;display:flex;flex-direction:column;flex:1}
.case h3{font-size:1.1rem;line-height:1.35}
.case .q{color:var(--muted);font-size:.95rem;margin:.6rem 0 1.2rem}
.case a{margin-top:auto;font-weight:700;text-decoration:none;color:var(--olive);border-bottom:2px solid var(--green);align-self:flex-start;padding-bottom:2px}
.case a:hover{color:var(--ink)}

/* Four case studies read better 2x2 than as 3 + 1 orphan.
   Scoped to #work so the six engagement cards keep their 3-across flow.
   Taller thumb because the cards are twice as wide here. */
#work .grid3{grid-template-columns:repeat(2,1fr)}
#work .case .thumb{height:220px}
@media(max-width:760px){
  #work .grid3{grid-template-columns:1fr}
  #work .case .thumb{height:190px}
}

.band{background:var(--ink);color:var(--paper);border-top:5px solid var(--green)}
.band h2,.band h3{color:var(--paper)}
.band .lede{color:#C9C6C1}
.band .eyebrow{color:var(--green)}
.band a.btn-secondary{border-color:var(--paper);color:var(--paper)}
.band a.btn-secondary:hover{background:var(--paper);color:var(--ink)}

/* ==========================================================================
   CASE STUDIES PAGE
   ========================================================================== */
.toc{background:#fff;padding:1.8rem 2rem;border-left:5px solid var(--green);margin:2.5rem 0 3rem}
.toc h2{font-size:1.15rem;color:var(--olive);margin-bottom:.9rem}
.toc ul{list-style:disc;margin:0 0 0 1.3rem}
.toc li{margin:.6rem 0;padding-left:.3rem}
.toc li::marker{color:var(--green)}
.toc a{color:var(--ink);text-decoration:none;font-weight:600;border-bottom:2px solid var(--green);padding-bottom:1px}
.toc a:hover{color:var(--olive)}

.case-study-section{margin:4rem 0;padding-top:2.5rem;border-top:1px solid var(--hair);scroll-margin-top:120px}
.case-study-section:first-of-type{border-top:none;padding-top:0;margin-top:0}

.case-header{display:flex;align-items:flex-start;gap:2rem;margin-bottom:2rem;flex-wrap:wrap}

/* THE FIX: the illustration container needs explicit dimensions, and the
   image inside needs to be contained within them. Source art is @4x. */
.case-icon{flex:0 0 280px;width:280px;height:190px;background:var(--olive);
           display:flex;align-items:center;justify-content:center;padding:1rem;overflow:hidden}
.case-icon img{width:100%;height:100%;object-fit:contain}

.case-title{flex:1;min-width:260px}
h2.case-name{font-size:clamp(1.4rem,2.6vw,1.9rem);color:var(--ink);margin-bottom:.6rem;line-height:1.25}
.case-meta{margin-top:.9rem;font-size:.9rem}
.meta-label{font-weight:700;color:var(--olive)}
.meta-value{color:var(--muted)}

.info-box{padding:1.6rem 1.8rem;margin:1.6rem 0;background:#fff;border-left:5px solid var(--hair)}
.info-box h3{margin-top:0;font-size:1.05rem;letter-spacing:.06em;text-transform:uppercase}
.info-box p:last-child{margin-bottom:0}
/* Issue / Approach / Result are NOT ORCA elements, so they take brand colors,
   not OOUX colors. Progression runs dark to bright as the story resolves. */
.issue-box{border-left-color:var(--muted)}
.approach-box{border-left-color:var(--olive)}
.result-box{border-left-color:var(--green);background:rgba(23,178,75,.05)}

.cta-box{background:var(--ink);color:var(--paper);padding:3rem 2rem;text-align:center;margin:4rem 0;border-top:5px solid var(--green)}
.cta-box h3{color:var(--paper);font-size:1.6rem;margin-bottom:.8rem}
.cta-box p{margin-bottom:1.8rem;font-size:1.05rem;color:#C9C6C1}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer{padding:2.8rem 0;border-top:1px solid var(--hair);color:var(--muted);font-size:.92rem}
footer a{color:var(--olive);font-weight:600}
.orca-tag{color:var(--olive);font-weight:700;letter-spacing:.04em}

@media(max-width:768px){
  .container{padding:0 1.25rem}
  .case-header{flex-direction:column;gap:1.2rem}
  .case-icon{flex:0 0 auto;width:100%;height:200px}
}
