/* Base: variables populated dynamically from logo via script.js */
:root {
  /* TriDigital Color Palette - Clean & Modern */
  --brand-primary: #1A73E8;   /* Clean Blue */
  --brand-accent:  #34A853;   /* Green */
  --brand-dark:    #202124;   /* Deep Gray */
  --brand-light:   #F8F9FA;   /* Light Gray */
  --brand-coral:   #EA4335;   /* Red */
  --text:          #202124;
  --text-muted:    #5F6368;
  --bg:            #FFFFFF;
  --surface:       #F8F9FA;
  --surface-solid: #FFFFFF;
  --border:        #DADCE0;
  --shadow-sm:     0 1px 2px rgba(32, 33, 36, 0.08);
  --shadow-md:     0 2px 8px rgba(32, 33, 36, 0.12);
  --shadow-lg:     0 4px 16px rgba(32, 33, 36, 0.16);
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --transition:    all 200ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.6;
  padding-top: 72px;
}

.container { width: min(1200px, 90vw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #FFFFFF; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.header-wrap { display: flex; align-items: center; gap: clamp(12px, 3vw, 24px); padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; transition: var(--transition); }
.brand:hover { transform: translateY(-1px); }
.logo { border-radius: var(--radius-md); transition: var(--transition); }
.brand:hover .logo { transform: scale(1.02); }
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 18px; color: var(--text); text-transform: uppercase; tracking-letter: -0.02em; }
.nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; padding: 10px 16px; border-radius: var(--radius-sm); transition: var(--transition); font-size: 15px; }
.nav a:not(.btn):hover { background: var(--surface); color: var(--text); }
.nav .btn.primary { background: var(--brand-primary); border: none; box-shadow: var(--shadow-sm); color: white; }
.nav .btn.primary:hover { background: #1765CC; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.nav-toggle { display: none; margin-left: auto; border: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; padding: 8px; border-radius: var(--radius-sm); transition: var(--transition); color: var(--text); }
.nav-toggle:hover { background: var(--surface); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 28px; border-radius: var(--radius-md); font-weight: 600; text-decoration: none; border: none; color: var(--text); transition: var(--transition); font-size: 15px; cursor: pointer; position: relative; overflow: hidden; }
.btn::before { display: none; }
.btn:hover::before { display: none; }
.btn.primary { background: var(--brand-primary); color: white; box-shadow: var(--shadow-md); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); background: #1765CC; }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: var(--surface-solid); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { background: var(--surface); box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* Hero */
.hero { position: relative; overflow: hidden; min-height: clamp(500px, 70vh, 750px); display: flex; align-items: center; }
.hero-content { padding: clamp(60px, 12vh, 120px) 0; text-align: left; position: relative; z-index: 10; width: 100%; isolation: isolate; }
.hero h1 { font-size: clamp(48px, 8.5vw, 84px); line-height: 1.08; margin: 0 0 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); display: inline-block; text-align: left; }
.hero .subtitle { font-size: clamp(18px, 2.6vw, 24px); color: var(--text-muted); margin: 0 auto 36px; font-weight: 400; max-width: 600px; line-height: 1.5; text-align: center; }
.hero .cta { display: inline-flex; gap: 16px; flex-wrap: wrap; justify-content: flex-start; }
.hero-bg { position: absolute; inset: 0; z-index: 1;
  background: rgba(255, 255, 255, 0.30);
}

/* Sections */
.section { padding: clamp(64px, 10vw, 100px) 0; }
.section.alt { background: var(--surface); position: relative; }
.section.alt::before { display: none; }
.section h2 { font-size: clamp(32px, 4vw, 44px); margin: 0 0 12px; font-weight: 700; letter-spacing: -0.02em; }
.section-lead { color: var(--text-muted); margin-bottom: 42px; font-size: clamp(16px, 2vw, 19px); max-width: 800px; line-height: 1.6; }

.hero-table { width: 100%; max-width: 1200px; margin: 0 auto; border-collapse: collapse; }
.hero-table tr:first-child { height: 500px; }
.hero-image-cell { width: 50%; padding-right: clamp(16px, 4vw, 40px); vertical-align: middle; position: relative; }
.image-wrapper { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; padding-right: clamp(16px, 4vw, 40px); }
.hero-text-cell { width: 50%; vertical-align: middle; text-align: center; }
.hero-cta-cell { padding-top: 24px; text-align: center; }
.feature-image { max-width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.accent-initial { color: var(--brand-primary); }

.cards { display: grid; grid-template-columns: repeat( auto-fit, minmax(280px, 1fr) ); gap: 24px; }
.card { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-primary); opacity: 0; transition: opacity 200ms ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 12px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-muted); line-height: 1.65; font-size: 15px; }

/* R/E/A/L */
.rea { display: grid; grid-template-columns: repeat( auto-fit, minmax(260px, 1fr) ); gap: 24px; }
.rea-item { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; }
.rea-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rea-letter { height: 80px; width: 80px; border-radius: var(--radius-md); display: grid; place-items: center; font-weight: 700; font-size: 40px; color: white; background: var(--brand-primary); box-shadow: var(--shadow-md); position: relative; letter-spacing: -0.02em; }
.rea-letter::after { display: none; }
@keyframes pulse-glow { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.rea-item h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.rea-item p { margin: 0; color: var(--text-muted); line-height: 1.65; }

/* Highlights */
.highlights { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; max-width: 800px; }
.highlights li { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 22px; box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; padding-left: 50px; font-size: 15px; }
.highlights li::before { content: '✓'; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--brand-accent); color: white; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.highlights li:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }

/* Blog */
.blog-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.blog-post { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); transition: var(--transition); }
.blog-post:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.blog-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 14px; color: var(--text-muted); }
.blog-category { background: var(--brand-primary); color: white; padding: 4px 10px; border-radius: var(--radius-sm); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.blog-post h3 { margin: 0 0 12px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.blog-post h3 a { color: var(--text); text-decoration: none; transition: var(--transition); }
.blog-post h3 a:hover { color: var(--brand-primary); }
.blog-post p { margin: 0 0 16px; color: var(--text-muted); line-height: 1.65; font-size: 15px; }
.blog-link { color: var(--brand-primary); text-decoration: none; font-weight: 600; font-size: 15px; transition: var(--transition); }
.blog-link:hover { color: #1765CC; }

/* Blog Article Pages */
.blog-article { padding: clamp(40px, 8vw, 80px) 0; }
.blog-header { max-width: 800px; margin: 0 auto 48px; }
.back-link { color: var(--brand-primary); text-decoration: none; font-weight: 500; display: inline-block; margin-bottom: 24px; transition: var(--transition); }
.back-link:hover { color: #1765CC; }
.blog-header h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.2; margin: 16px 0 20px; font-weight: 700; letter-spacing: -0.02em; }
.blog-lead { font-size: clamp(18px, 2.5vw, 22px); color: var(--text-muted); line-height: 1.6; margin-bottom: 0; }
.blog-content { max-width: 800px; margin: 0 auto; line-height: 1.8; }
.blog-content h2 { font-size: clamp(24px, 3.5vw, 32px); margin: 48px 0 16px; font-weight: 700; letter-spacing: -0.01em; }
.blog-content h3 { font-size: clamp(20px, 2.8vw, 24px); margin: 32px 0 12px; font-weight: 600; letter-spacing: -0.01em; }
.blog-content p { margin: 0 0 20px; color: var(--text); }
.blog-content ul, .blog-content ol { margin: 0 0 20px; padding-left: 28px; }
.blog-content li { margin-bottom: 12px; color: var(--text); }
.blog-content strong { font-weight: 600; color: var(--text); }
.blog-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; margin: 48px 0; text-align: center; }
.blog-cta h3 { margin: 0 0 12px; font-size: 24px; }
.blog-cta p { margin: 0 0 24px; color: var(--text-muted); }

/* Contact */
.contact { text-align: center; }
.contact h2 { margin-bottom: 16px; }
.contact p { margin-bottom: 28px; }
.contact .btn { margin-top: 8px; }

/* Card Links */
.card-link { color: var(--brand-primary); text-decoration: none; font-weight: 600; font-size: 15px; transition: var(--transition); display: inline-block; margin-top: 12px; }
.card-link:hover { color: #1765CC; }

/* Utility Tool Styles */
.util-tool-section { background: var(--surface); }
.util-tool-container { background: var(--surface-solid); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-md); }
.tool-wrapper h2 { font-size: clamp(28px, 3.5vw, 36px); margin-bottom: 12px; }

/* Form Styles */
.input-section { margin-bottom: 30px; }
.form-group { width: 100%; }
.form-group label { display: block; margin-bottom: 10px; font-weight: 600; color: var(--text); font-size: 15px; }
.input-wrapper { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
input[type="text"] { flex: 1; min-width: 250px; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: 15px; transition: var(--transition); font-family: inherit; }
input[type="text"]:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1); }
.input-wrapper .btn.primary { flex-shrink: 0; }

/* Error Message */
.form-group .error { color: var(--brand-coral); font-size: 13px; margin-top: 5px; display: block; }
.error-message { background-color: #fee2e2; color: var(--brand-coral); padding: 16px; border-radius: var(--radius-md); margin-bottom: 20px; border-left: 4px solid var(--brand-coral); }
.error-message.hidden { display: none; }

/* Loading Spinner */
.loading { text-align: center; padding: 60px 20px; }
.loading.hidden { display: none; }
.spinner { border: 4px solid var(--surface); border-top: 4px solid var(--brand-primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Results Section */
.results-section { display: none; }
.results-section:not(.hidden) { display: block; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.results-section.hidden { display: none; }

/* Summary Card */
.summary-card { background: white; color: var(--text); padding: 30px; border-radius: var(--radius-lg); margin-bottom: 30px; box-shadow: var(--shadow-md); border: 3px solid #EA580C; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.summary-item { display: flex; flex-direction: column; }
.summary-item .label { font-size: 13px; opacity: 0.9; margin-bottom: 5px; font-weight: 500; }
.status-badge, .score, .domain { font-size: 20px; font-weight: 700; }
.status-badge.success, .status-badge.compliant { color: #34A853; font-weight: 700; }
.status-badge.error, .status-badge.non-compliant { color: #EA4335; font-weight: 700; }
.status-badge.warning { color: #EA580C; font-weight: 700; }
.status-badge.info { color: #0891b2; font-weight: 700; }

/* Checks Container */
.checks-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.check-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; transition: var(--transition); background: var(--surface-solid); border-left: 4px solid transparent; }
.check-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.check-card.success { border-left: 4px solid #34A853; }
.check-card.error { border-left: 4px solid #EA4335; }
.check-card.warning { border-left: 4px solid #EA580C; }
.check-card h3 { font-size: 18px; margin-bottom: 15px; color: var(--text); }
.check-item { margin-bottom: 12px; font-size: 14px; color: var(--text); }
.check-item.success { color: #34A853; font-weight: 600; }
.check-item.error { color: #EA4335; font-weight: 600; }
.check-item.warning { color: #EA580C; font-weight: 600; }
.check-item.info { color: #0891b2; font-weight: 600; }
.check-icon { margin-right: 8px; font-weight: bold; }

/* Compliance Card */
.compliance-card { background: var(--surface); padding: 30px; border-radius: var(--radius-lg); margin-bottom: 30px; border: 1px solid var(--border); }
.compliance-card h2 { margin-bottom: 25px; color: var(--text); font-size: clamp(24px, 3vw, 28px); }
.compliance-section { margin-bottom: 25px; }
.compliance-section h3 { font-size: 17px; margin-bottom: 15px; color: var(--text); font-weight: 600; }
.compliance-item { margin-bottom: 10px; font-size: 14px; padding: 8px 0; padding-left: 24px; position: relative; color: var(--text); }
.compliance-item::before { content: '✓'; position: absolute; left: 0; color: #34A853; font-weight: bold; }
.compliance-item.pass { color: #34A853; font-weight: 600; }
.compliance-item.pass::before { content: '✓'; color: #34A853; }
.compliance-item.fail { color: #EA4335; font-weight: 600; }
.compliance-item.fail::before { content: '✗'; color: #EA4335; }
.compliance-score { font-weight: 700; font-size: 16px; padding: 10px 0; margin-top: 10px; }
.compliance-status { margin-top: 20px; padding: 20px; border-radius: var(--radius-md); text-align: center; font-weight: 600; font-size: 16px; }
.compliance-status.compliant { background-color: #dcfce7; color: #34A853; border: 1px solid #34A853; }
.compliance-status.non-compliant { background-color: #fee2e2; color: #EA4335; border: 1px solid #EA4335; }

/* Recommendations Card */
.recommendations-card { background: #fef3c7; border-left: 4px solid #EA580C; padding: 20px; border-radius: var(--radius-md); margin-bottom: 20px; }
.recommendations-card h3 { color: #EA580C; margin-bottom: 15px; font-weight: 600; }
.recommendations-card ul { list-style: none; padding: 0; }
.recommendations-card li { padding: 8px 0; padding-left: 25px; position: relative; color: var(--text); font-size: 14px; }
.recommendations-card li:before { content: "⚠"; position: absolute; left: 0; color: #EA580C; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-solid); }
.site-footer .container { padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Mobile nav */
@media (max-width: 880px) {
  .nav { display: none; }
  .nav[aria-expanded="true"] { display: grid; grid-auto-flow: row; gap: 4px; background: var(--surface-solid); position: absolute; top: calc(100% + 8px); right: 4%; padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .nav-toggle { display: inline-block; }
  .hero { background-attachment: scroll; }
  .hero-table, .hero-table tr, .hero-table td { display: block; width: 100%; }
  .hero-table tr:first-child { height: auto; }
  .hero-image-cell { padding-right: 0; margin-bottom: 24px; position: static; }
  .image-wrapper { position: static; padding-right: 0; display: block; }
  .hero .cta { justify-content: center; }
  .rea-item { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(32px, 9vw, 48px); }
  .input-wrapper { flex-direction: column; }
  input[type="text"], .input-wrapper .btn.primary { width: 100%; }
  .summary-grid { grid-template-columns: 1fr; }
  .checks-container { grid-template-columns: 1fr; }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .rea-letter::after { animation: none; }
}

/* Hidden utility */
.hidden { display: none !important; }
